Harddisks can be damaged so it is important to backup projects on different medias - other harddisk, optical discs or flashdisks.
If you are on Linux you can use following shell script.
#!/bin/sh
MyProjectsDir='/home/user/Projects'
MyBackupsDir='/home/user/Backups'
MyProject_Dir='Project1'
FullProjectPath=$MyProjectsDir/$MyProject_Dir
if [ ! -x $FullProjectPath ]; then
if [ ! -x $MyBackupsDir ]; then
echo Destination directory $MyBackupsDir NOT found.
exit 0
fi
echo Source directory $FullProjectPath NOT found.
exit 0
fi
Separator='_'
NewBackupDir=$MyProject_Dir$Separator"$(date +%y-%m-%d)"
FullBackupsPath=$MyBackupsDir/$NewBackupDir
if [ -x $FullBackupsPath ]
then
echo $FullBackupsPath already exists.
echo -n 'Type [y], [Y] or [Enter] to continue, other key to exit: '
read item
if [[ $item != "Y" && $item != "y" && $item != "" ]];
then exit
fi
fi
mkdir -p $FullBackupsPath
rsync -av --include='**/' --include='*.bak' --include='*.bat' --include='*.compiled' \
--include='*.ico' --include='*.ini' --include='*.html' --include='*.lfm' \
--include='*.lpk' --include='*.lpi' --include='*.lpr' --include='*.lrs' \
--include='*.or' --include='*.pas' --include='*.png' --include='*.pp' \
--include='*.rc' --include='*.res' --include='*.sh' \
--exclude='*' $FullProjectPath/ $FullBackupsPath
If you have directory structure like this:
/home/user/Backups
|-/Projects/Project1
|-/Project2
|-/Project3
...
and if you set script for EACH project properly then each script will create new directory and will backup your project:
/home/user/Backups/Project1_11-05-11
|-/Project2_11-05-11
|-/Project3_11-05-11
...
You need only set user name, source path, destination path and project directory (it is 3-rd, 4-th and 5-th line of the script).
Script backups files in dependency on their extensions and it omits files *.dbg, *.ppu, *.o and executables. Decide yourselves what you want backup and modify script for your own purposes. Generated backups can be also easily burned to CD / DVD with K3B or Brasero.
You can run script manually or you can add it to CRON and it will run automaticly everyday (or in other period). You can configure CRON in GUI - in KDE4 it is in System Settings -> Scheduler.
Bye!