I'm running eclipse on windows and would like to automatically backup my src direcories for all my projects. I installed cygwin and tried to make a simple backup script but I am having trouble properly specifying the destination filename. The backups should be in the current directory.directory of the script.
#!/bin/bash
for f in /cygdrive/c/Documents\ and\ Settings/USERNAME/My\ Documents/Eclipse\ Workspace/*
do
echo "in folder \"$f\""
cp -a "$f"/src/ ./????.bak
done
I would like ???? to be the project folder (not the absolute path). Thanks.
rsyncis a good tool to maintain backups. It only copies the files which are changed. instead of the whole bunch of files. linux.die.net/man/1/rsync – Pitt Oct 24 '12 at 16:00rsync) like e.g.rdiff-backup. But rather follow @Gilles's and @sparticvs's advice: revision control! – fheub Oct 25 '12 at 6:36