LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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-15-2005, 12:08 PM   #1
lordofring
Member
 
Registered: Feb 2005
Posts: 91

Rep: Reputation: 15
backup script question


Hello,

I have an incremental backup script for my linux box. I used "find -mtime 1" to find all of files accessed on today. But the result is huge. If a file name is changed, the directory is returned. So the whole directory is backed up. At the end, the size is too big for me to backup everyday.

So I modified a little to "find -mtime 1 -type f". The return is much smaller since it only return the files changed on today. But it bring me another problem. If I changed a directory's name like "mv dir1 dir2", nothing will be backup because no file is changed. It will cause my problem when I resotre it in the emergency case.

Anyone could give me some hint to accomplish these two goals together?

thanks
 
Old 04-15-2005, 12:23 PM   #2
tangle
Senior Member
 
Registered: Apr 2002
Location: Smithville, TN
Distribution: Slackware
Posts: 1,744

Rep: Reputation: 70
When I get home I'll post the find command and how to get tar to backup the files. I do not have the info onhand right now, sorry.
 
Old 04-15-2005, 12:37 PM   #3
abhijeetudas
Member
 
Registered: Sep 2004
Distribution: Redhat / Fedora
Posts: 114

Rep: Reputation: 15
Hi,

Im need to do incremental backups too..
could u paste the script u use so i can use
the script too..
 
Old 04-15-2005, 01:26 PM   #4
Madd_hatter
LQ Newbie
 
Registered: May 2004
Posts: 15

Rep: Reputation: 0
Not to say there's not a way to fix your script, I have no idea. But have you looked into partimage? It's a linux backup utility that does incremental backups. I haven't personally used it but I was looking into it and I think it might suit your needs nicely.
 
Old 04-15-2005, 09:29 PM   #5
tangle
Senior Member
 
Registered: Apr 2002
Location: Smithville, TN
Distribution: Slackware
Posts: 1,744

Rep: Reputation: 70
Sorry for the late post.

The find command you need is:
find / -mtime -1 \! -type d -print > /tmp/filelist.daily

This will find all files accessed in the last 24 hours and print the list to the file /tmp/filelist.daily.

To get tar to read the list and archive the files:
tar -cv -T /tmp/filelist.daily -f /mnt/share

This will create the tarball in the /mnt/share directory.
 
Old 04-16-2005, 06:59 AM   #6
lordofring
Member
 
Registered: Feb 2005
Posts: 91

Original Poster
Rep: Reputation: 15
Thanks tangle. I will try it on Monday.
 
Old 04-18-2005, 10:19 AM   #7
lordofring
Member
 
Registered: Feb 2005
Posts: 91

Original Poster
Rep: Reputation: 15
Hello,

After I run "find / -mtime -1 /! -type d ", I will get the all files that changed in 24 hours. It does not solve my problem. My problem is that if a directory only changed name by "mv", the super-directory's last modified time is changed and so the whoe super-directory is backed up. I do not want to waste space. (I only want to backup the directory with the new name.)

Thank you the reply.
 
Old 04-18-2005, 10:25 AM   #8
tangle
Senior Member
 
Registered: Apr 2002
Location: Smithville, TN
Distribution: Slackware
Posts: 1,744

Rep: Reputation: 70
Sorry, I mis read the post. I believe that you can use the touch command to change the access time for files and directories.

http://www.computerhope.com/unix/utouch.htm

Then all you have to do is touch the directory and/or files after you move them.
 
  


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
Backup script raptorman Programming 4 08-22-2005 09:52 AM
backup script nitaish Linux - General 1 04-22-2005 11:31 AM
What backup script do you use? buldir Linux - Software 1 04-12-2005 02:57 PM
Backup script question ! emailssent Programming 7 12-02-2004 07:43 PM
backup script ixion Linux - Software 2 01-09-2003 06:39 AM


All times are GMT -5. The time now is 03:40 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration