Syntax:
rsync -ahP {source} {destination} 2> ~/Desktop/rsyncErrors.txtExample:
rsync -ahP ~/Documents /Volumes/backup 2> ~/Desktop/rsyncErrors.txt| #!/bin/bash | |
| currdate=`date +"%Y-%m-%d %T"` | |
| folders=("Backup Documents Sites") | |
| echo -e "\n---[${currdate}]---\n" >> ~/backup_stdout.log | |
| echo -e "\n---[${currdate}]---\n" >> ~/backup_stderr.log | |
| for folder in $folders | |
| do | |
| echo "Copying $folder..." | |
| #ls ~/$folder 1>> ~/backup_stdout.log 2>> ~/backup_stderr.log | |
| rsync -ahP ~/$folder /Volumes 1>> ~/backup_stdout.log 2>> ~/backup_stderr.log | |
| done |
tar --exclude=.DS_Store --no-mac-metadata --totals -cvzf ~/MagPi.tar.gz ~/Bookshelf/MagPisplit -d -b 1G MagPi.tar.gz "MagPi.tar.gz.part"cat MagPi.tar.gz.part* > MagPi.tar.gztar -tvzf ~/MagPi.tar.gztar -xvzf ~/MagPi.tar.gz