Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- domain=( mydomain.com )
- opath=$HOME/backup/
- webdir=$HOME/mydir.com
- today=$(date +%m-%d-%Y)
- for (( i = 0; i < ${#domain[@]}; i++))
- do
- cpath=$opath${domain[$i]}
- if [ -d $cpath ]
- then
- filler="just some action to prevent syntax error"
- else
- echo Creating $cpath
- mkdir -p $cpath
- fi
- zip -r ${cpath}/"$today"_"$domain".zip $webdir
- done
- #use aws-cli to upload
- aws s3 sync $opath s3://mybucket/backups/ --exclude "$opath""*.sh"
- #delete backup from web server
- find $HOME/backup/* -type d -exec rm -rf {} \; 2> /dev/null
Advertisement
Add Comment
Please, Sign In to add comment