Skip to content

Instantly share code, notes, and snippets.

@mikhailov
Created November 19, 2009 05:59
Show Gist options
  • Save mikhailov/238578 to your computer and use it in GitHub Desktop.
Save mikhailov/238578 to your computer and use it in GitHub Desktop.
automate backup and dvd burn
#!/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