Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Fileserver Backup Script
- #Yesterdays date in ISO-8601 format:
- DAY1=`ls /mnt/htmlephant/hostgator | tail -n 1`
- #Todays date in ISO-8601 format:
- DAY0=`date -I`
- mkdir -p /mnt/htmlephant/hostgator/hostgator_backup__$DAY0/home
- for D in $(find /home/ -mindepth 1 -maxdepth 1 -type d) ; do
- #The source directory:
- SRC="$D/public_html"
- #The target directory:
- TRG="/mnt/htmlephant/hostgator/hostgator_backup__$DAY0$D"
- #The link destination directory:
- LNK="/mnt/htmlephant/hostgator/$DAY1$D/public_html/"
- #The rsync options:
- OPT="-avh --delete --link-dest=$LNK"
- echo rsync $OPT $SRC $TRG
- rsync $OPT $SRC $TRG
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement