Created
November 19, 2009 05:59
-
-
Save mikhailov/238578 to your computer and use it in GitHub Desktop.
automate backup and dvd burn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
folder=/media/storage/Backup/ | |
file=$folder/backup_$(date +"%Y_%m_%d_%H-%M") | |
echo 'Change directory and remove files older than 7days' | |
cd $folder | |
find *.tgz -mtime +7 |xargs rm | |
echo 'Backup process...' | |
if [ -d $folder ]; then | |
cd /home/mikhailovanatoly/ | |
tar czf $file.tgz .Skype .mozilla .mozilla-thunderbird .opera .purple .ssh Documents Projects scripts .bashrc .gitconfig .vimrc > /dev/null | |
fi | |
echo 'Erase and burn dvd-rw, then eject' | |
dvd+rw-format /dev/scd0 | |
growisofs -Z /dev/scd0 -R -J $file.tgz | |
eject | |
# In case of Ubuntu 9.04/9.10 | |
# make sure you have installed libnotify-bin | |
notify-send 'Backup is done! Take care about the dvd disc' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment