dolorosus / RaspiBackup

Backup your raspi
GNU General Public License v3.0
13 stars 3 forks source link

fixed typo's and tweaked (?) exclude on home .cache #5

Closed ephestione closed 5 years ago

dolorosus commented 5 years ago

Thanks for finding the typos

But: --exclude='home/*/.cache/**' \ will assume that the home directory is named "/home"

--exclude='${HOME##/}/.cache/**' uses the systemvar $HOME for determing the home directory. So I think this is the universal way of determing the homedirectory

ephestione commented 5 years ago

Yes, $HOME is a nice and elengant shortcut, yet there's an intrinsic problem with this: since I think the normal way of running this backup is from root's crontab, $HOME for root will be /root or something else, which doesn't even exist, while the real home folder will be /home/username. So you have to make sure the script excludes the right folder, either there's some way to pull off from the system a list of users with their homes, or you hardcode the foldername in the script and have the user fill it, or you take a shortcut and just exlude /.cache inside any first level folder under /home. Am I missing something?

dolorosus commented 5 years ago

I've been thinking about the problem for some time. I don't think it's worth thinking about it.

Normally .cache is relatively small (1-2MB). If chromium is used, the size increases rapidly. BUT it's way better to mount .cache/chromium on a filesystem in RAM. This prevents the sdcard from wearing out and is really faster.

Just do the same you do normally for /var/log. E.g. useing a zram filesystem.
(https://www.raspberrypi.org/forums/viewtopic.php?t=237735)

ephestione commented 5 years ago

It's not a major problem, my headless system .cache is 4MB so I won't really notice it. Yet it's cool to save 4mb with just a line of code ;) I just tried with --exclude='home/*/.cache/**' --delete-excluded and the log showed that the .cache folder in my home was deleted from the backup BTW the correct spelling is successful without the s after double c :smile:

dolorosus commented 5 years ago

Thanks I corrected these typos succesful in the master branch...