Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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