Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-12-2003, 04:06 AM   #1
Registered: Jan 2002
Posts: 157

Rep: Reputation: 30
the diff command or any other similar things

hi all..

i have a huge directory with many subfolders and many files in each folder ..

i usually back up the directory each week .. usually it is a full back up ...

offcourse i add some files or even subfolders in this main folder during the week ... and i would like to KNOW the NEW files that have been added each time i do the backup ..

well .. i made this small script :

tar -czvf backup.tar.gz MainFolder/ > temp.txt

this script will simply show whatever was displayed on the screen in a file called temp.txt ...

the next time i do a run this script .. it will generate a new file called temp.txt .. ofcourse i would take a copy of the first temp.txt or change its name so it wont overwrite it.

now we have two temp files that have some difference in them ..

to know the difference .. we run the diff command ... this is known

the problem is that the diff command will result i having a big file that has all these:

things on it ... and for huge files ... this won't be a practical way of knowing the new files

my questions is .. is there any way to have a txt file that sows clearly what new files are added? or deleted?

when i say clearly i mean .. no >> or << .. .only lines of the number of new files added or deleted ...

thanks in advance
Old 02-12-2003, 04:20 AM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,650

Rep: Reputation: 210Reputation: 210Reputation: 210
Maybe you need a CVS? Then you can simply (from console or using GUI frontend) see which files were modified, when, which are new and so on. ANd allows you to see modifications between version. Very useful, but I'm not sure if that's what you want.
Old 02-12-2003, 09:37 AM   #3
Senior Member
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Why not just use --newer

tar -czvf backup.tar.gz --newer="2003-02-10 12:00:00" MainFolder/

You could always place the timestamp of the last archive in a file. Something like:
date +"%Y-%m-%d %H:%M:%S" > /tmp/lastarchived

Then when you archive you can run the command:
tar -czvf backup.tar.gz --newer=`cat /tmp/lastarchived`MainFolder/
Old 02-12-2003, 09:46 AM   #4
Registered: Jan 2002
Posts: 157

Original Poster
Rep: Reputation: 30
Mara .. hmmmmmmmmm isn't this something used for projects and programming versions?? is there any thing simpler?

Mik .. well .. i knew the time stamp thingy but i wasn't remembring the right command .. so i said in this post i'll just make sure to change the name

thanks alot

any other suggestions?
Old 02-12-2003, 10:07 PM   #5
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
would the -u (update) option do the job for you? maybe you should read "man tar" to see what fits your needs.


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
help on diff command anandss2004 Programming 2 11-01-2005 12:58 PM (or similar command)...formatting output Basslord1124 Linux - Newbie 2 02-27-2005 05:13 PM
Dual Boot diff Hard Disk diff OS on Suse 9.1 wilhem Linux - Newbie 1 08-13-2004 06:06 PM
mounting things in Debian and the mount command petkov Debian 5 07-09-2004 05:51 PM
Exsists in Linux a command similar to ipconfig? zWaR Linux - Newbie 1 03-05-2004 05:27 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:20 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