LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 04-23-2007, 05:18 AM   #1
linusneumann
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.

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

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

http://www.dirvish.org
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:24 PM.

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