Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bash: #!/bin/bash
- # Current Date
- l_date=$(date +%Y%m%d%H%M%S)
- # Path to Drop Box Files
- drop_path ='/home/Dropbox-Uploader'
- # My Hostname
- host=$(hostname)
- # Path to where to store the backup files
- path='/home/backup'
- # Email Address where to email Archive
- email='tom@acme.com'
- # TAR / GZ files and store list of files in $backup_files
- backup_files=$(tar -cvzf $path/$host_${l_date}.tar.gz /var/www/html/api/src /var/www/html/api/public)
- # Email copy of Archive to email
- echo "$backup_files" | mail -s "Latest Backup of $host" $email -A $path/$host_${l_date}.tar.gz
- # Upload copy of Archive to Dropbox Folder
- $drop_path/dropbox_uploader.sh upload $path/$host_${l_date}.tar.gz $host_${l_date}.tar.gz
Add Comment
Please, Sign In to add comment