Hi, I found an old external hard drive and I was thinking of creating a backup/restore point of my system to use in case something fails after an update or any other problem. My HDD has 465GB of available space.
I was watching some tutorials and researching the best option, but I’m not sure how much space I need.
I ran sudo du -sh --exclude=/home /
and got 86GB
for /
(I’m not sure why I got “Permission denied” since I used sudo).
du: cannot access '/run/user/1000/doc': Permission denied
du: cannot read directory '/proc/8365/task/8365/net': Invalid argument
du: cannot read directory '/proc/8365/net': Invalid argument
du: cannot access '/proc/52576/task/52576/fd/4': No such file or directory
du: cannot access '/proc/52576/task/52576/fdinfo/4': No such file or directory
du: cannot access '/proc/52576/fd/3': No such file or directory
du: cannot access '/proc/52576/fdinfo/3': No such file or directory
86G /
I then ran sudo du -sh /home
and the result was:
525G /home
Seeing this, my HDD isn’t large enough. So, I was thinking it might be a good idea to create the backups/restore points while excluding unnecessary folders like these:
sudo du -sh --exclude=/home --exclude=/root/.cache --exclude=/tmp --exclude=/var/tmp --exclude=/var/cache /
sudo du -sh \
--exclude='/home/*/Projects/*/node_modules' \
--exclude='/home/*/Projects/*/build' \
--exclude='/home/*/VirtualBox VMs' \
--exclude='/home/*/.local/share/libvirt' \
--exclude='/home/*/Games' \
--exclude='/home/*/.steam' \
--exclude='/home/*/Videos' \
--exclude='/home/*/Music' \
--exclude='/home/*/Pictures' \
--exclude='/home/*/tmp' \
--exclude='/home/*/.local/share/Trash' \
--exclude='/home/*/.cache' \
--exclude='/home/*/Downloads' \
/home
After this, the result was:
58G /
310G /home
Perfect for my HDD.
So my final command:
sudo timeshift --create --comments "Backup / and home" --tags D --exclude "/home/*/Projects/*/node_modules,/home/*/Projects/*/build,/home/*/VirtualBox VMs,/home/*/.local/share/libvirt,/home/*/Games,/home/*/.steam,/home/*/Videos,/home/*/Music,/home/*/Pictures,/home/*/tmp,/home/*/.local/share/Trash,/home/*/.cache,/home/*/Downloads,/root/.cache,/tmp,/var/tmp,/var/cache
- Is excluding these folders a good idea?
- IIs there a better or alternative way that you would recommend?
- Are there any other unnecessary folders that I can exclude?
Thanks for your time!