Syntax:
rsync -ahP {source} {destination} 2> ~/Desktop/rsyncErrors.txt
Example:
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/MagPi
split -d -b 1G MagPi.tar.gz "MagPi.tar.gz.part"
cat MagPi.tar.gz.part* > MagPi.tar.gz
tar -tvzf ~/MagPi.tar.gz
tar -xvzf ~/MagPi.tar.gz