performing backup for tree of directors and applying certain operations on files
What I want to do is to backup my personal开发者_如何转开发 data (on a Linux boy) possibly using rsync. I want to include only certain files (jpg,nb,pdf,..) and exclude everything else. This is easily possible with rsync. What I also want to do is to apply certain operation on those files I backup since I need to save some disk space. So my idea is re resize my jpg's, zip my pdf's,... What do you think is the best approach to solve this (as easy as possible)? Kind Regards, André
First question how much space do you have at the destination?
mkdir -p /storage/backups/`date +\%Y-\%m-\%d`-`date +\%A`/$host/$username
rsync -avz /storage/backups/`date --date=yesterday +\%Y-\%m-\%d`-`date--date=yesterday +\%A`/$host/$username/ /storage/backups/`date +\%Y-\%m-\%d`-`date +\%A`/$host/$username/
rsync -avz -e ssh --delete --exclude='....' /home/username/ /storage/backups/`date +\%Y-\%m-\%d`-`date +\%A`/$host/$username/
This will keep the backups nice and neat just use the include/exclude option of rsync to only sycn file types you want to back up or use the way i described in this post Local rsync inclusion/exclusion
精彩评论