create folder-hierarchy for "revolutionary" (?) incremental backup
I am currently working on a *NIX "shellscript" which is suposed to make incremental backups using just the basic *NIX commands.
The "revolutionary" idea is that I just want the script to create symlinks in the backup folder to files that have changed since the last backup.
The folder Hierarchy is suppored to be preserved.
Why?
Every once in a while the laptop (running the scipt repeatedly via cron) is hoked up to my home network. In this instant my home machine accesses the backup folder and copies all files in it via scp.
By using symlinks the procedure will not copy files until hooked up to the net, but still create double files.
Also, the folder with the symlinks can be used for my extHDD backups... So please if you answer don't try to get me away from this idea, even if it might not be as revolutionary as I thought
The problem is, that in order to preserve the folder hierarchy, folders of files that have changed must be created before the links are set. The script I am posting is suppoed to be doing this, but sometimes it doesn't...
Here we go:
echo -n 'creating folder structure ';
find -L /Users/linusneumann/NETSYNC/sync/ -type d -follow -anewer /Users/linusneumann/NETSYNC/lastsync -exec mkdir -pv /Users/linusneumann/NETSYNC/files{} \;;
echo 'linking new files in created folder hierarchy...'; find -L /Users/linusneumann/NETSYNC/sync -type f -follow -cnewer /Users/linusneumann/NETSYNC/lastsync -exec ln -s {} /Users/linusneumann/NETSYNC/files{} \;;
date > /Users/linusneumann/NETSYNC/lastsync;
echo 'done'
|