Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
#!/bin/bash cd "$(dirname "$0")" backupfile=$(date +%Y%m%d) savetodir=./backup-$(date +%Y)/ host=ftp.example.com user=backup pass= if [ -d $host ]; then rm -r $host fi wget --recursive --level=inf --quiet --user=$user --password=$pass ftp://$host/ if [ $? -ne 0 ]; then echo "wget faild during the backup of $host" >&2 exit 1 fi tar -cf $backupfile.tar $host && gzip -c $backupfile.tar > $backupfile.tar.gz && rm $backupfile.tar if [ $? -ne 0 ]; then echo "faild to create a tar.gz during the backup of $host" >&2 exit 1 fi if [ ! -d $savetodir ]; then mkdir $savetodir fi mv $backupfile.tar.gz $savetodir exit 0
0 3 * * 3 boaz sh /mnt/array1/backup/n3rd.nl-sohosted/backup.sh
Remember Me
a@href@title, strike