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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-15-2005, 12:08 PM
|
#1
|
Member
Registered: Feb 2005
Posts: 91
Rep:
|
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
|
|
|
04-15-2005, 12:23 PM
|
#2
|
Senior Member
Registered: Apr 2002
Location: Arbovale, WV
Distribution: Slackware
Posts: 1,761
Rep:
|
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.
|
|
|
04-15-2005, 12:37 PM
|
#3
|
Member
Registered: Sep 2004
Distribution: Redhat / Fedora
Posts: 114
Rep:
|
Hi,
Im need to do incremental backups too..
could u paste the script u use so i can use
the script too..
|
|
|
04-15-2005, 01:26 PM
|
#4
|
LQ Newbie
Registered: May 2004
Posts: 15
Rep:
|
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.
|
|
|
04-15-2005, 09:29 PM
|
#5
|
Senior Member
Registered: Apr 2002
Location: Arbovale, WV
Distribution: Slackware
Posts: 1,761
Rep:
|
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.
|
|
|
04-16-2005, 06:59 AM
|
#6
|
Member
Registered: Feb 2005
Posts: 91
Original Poster
Rep:
|
Thanks tangle. I will try it on Monday.
|
|
|
04-18-2005, 10:19 AM
|
#7
|
Member
Registered: Feb 2005
Posts: 91
Original Poster
Rep:
|
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.
|
|
|
04-18-2005, 10:25 AM
|
#8
|
Senior Member
Registered: Apr 2002
Location: Arbovale, WV
Distribution: Slackware
Posts: 1,761
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 03:50 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|