Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 04-23-2007, 05:18 AM   #1
LQ Newbie
Registered: Apr 2007
Posts: 13

Rep: Reputation: 0
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.


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'
Old 04-23-2007, 04:20 PM   #2
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Rep: Reputation: 32
this has been done before, works just great for our department fileserver.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you create shortcuts to "folders" and "binaries" in GNOME? ebenh Linux - Desktop 5 01-21-2008 05:28 AM
LXer: "incremental Blogger" Offers Tablet PC Users Ink for Firefox Plug ... LXer Syndicated Linux News 0 06-13-2006 02:21 AM
"rm -rf /tmp", now Evolution shows "(no folder displayed" Ed-MtnBiker Linux - Software 7 04-10-2006 04:05 PM
"cannot exec `as': ..." AND "C compiler cannot create ..." pr3st0 Linux - Software 0 10-15-2004 12:42 PM
Nautilus, "Create Folder" problem... max74 Linux - Software 2 10-08-2003 05:28 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:15 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration