LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 09-13-2006, 01:39 PM   #16
tbeehler
Member
 
Registered: Aug 2003
Location: Washington State, USA
Distribution: Mainly RH 9.0
Posts: 227

Original Poster
Rep: Reputation: 30

Quote:
Originally Posted by unSpawn
./touchit.sh: illegal option -- m
+ case "$OPT" in
+ getopts s:d:l:th OPT

OK. Just add "m:".
Change the line "while getopts s:d:l:th OPT; do"
to read: "while getopts s:d:l:m:th OPT; do"


sh -x ./touchit.sh -t -m md5 -s /home/tbeehler/Desktop/old/ -d /home/tbeehler/Desktop/new/ -l 3 2>&1 | tee ./touchit.tee
BTW, try switch "-l 4" instead of 3. You'll why see if you use debug mode ("sh -x") like you already did.

Ok now I'm getting somewhere, but I have one minor issue left. I run the command sh ./touchit.sh -t -m diff -s /home/Tbeehler/Experiment/old -d /home/Tbeehler/Experiment/new -l 4 and it gives me a list of the actions that it's going to take such as:

touch -c -d 2006-09-13 10:38:27 /home/Tbeehler/Experiment/new/Reports
touch -c -d 2006-08-30 15:30:23 /home/Tbeehler/Experiment/new/Reports/test report.mdb
touch -c -d 2006-08-30 15:30:23 /home/Tbeehler/Experiment/new/Reports/test2.mdb
touch -c -d 2004-05-05 14:35:18 /home/Tbeehler/Experiment/new/Testing Document.doc
touch -c -d 2004-03-18 12:15:08 /home/Tbeehler/Experiment/new/budget-experiment.doc
touch -c -d 2006-09-13 11:01:27 /home/Tbeehler/Experiment/new/Test
touch -c -d 2006-09-13 11:01:27 /home/Tbeehler/Experiment/new/Test/test

however, it does not change the dates or times. I tried just copying and pasting one of the lines and the date works, but the time does not. I think this is because it's on a Debian 3.1 machine and touch has a new syntax??? I tried using the -m md5 option, but I get errors:

processing /home/Tbeehler/Experiment/old/Reports: failed in buffer_read(fd): mdfile: Is a directory
error processing /home/Tbeehler/Experiment/new/Reports: failed in buffer_read(fd): mdfile: Is a directory

then the list of files it's going to change, but it does not change them either.



I'm glad we are making progress though. You've been very helpful in dealing with this problem. Thank you in advance!
 
Old 09-13-2006, 02:24 PM   #17
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
however, it does not change the dates or times.
And so it should be: you're still using the test switch (-t).


processing /home/Tbeehler/Experiment/old/Reports: failed in buffer_read(fd): mdfile: Is a directory
Just ignore that. I should probably have written
Code:
sum_src=($(md5sum "${f}" 2>/dev/null)); sum_dst=($(md5sum "${dst_f}" 2>/dev/null));

You've been very helpful in dealing with this problem.
Well since I wrote the script I should be, right?
 
Old 07-25-2007, 04:20 AM   #18
indiancosmonaut
Member
 
Registered: Feb 2007
Posts: 65

Rep: Reputation: 15
This may sound a little odd, considering that you all are referring to some really good code.

Could someone explain how the following construct works1

Code:
progn=${0//*\//}
Thanks in advance

I also tried and hit on:

Code:
progn=${0/*\/}
both work fine.

Best regards,

indiancosmonaut

Last edited by indiancosmonaut; 07-25-2007 at 04:26 AM.
 
  


Reply



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
Delete/move/copy files of specific date imsajjadali Red Hat 26 11-07-2013 11:34 PM
CLI copy files by date linuxhippy Slackware 2 06-23-2006 09:01 PM
Time and Date on files Azhrarn Linux - Newbie 2 09-05-2005 04:32 AM
Copy files after a certain date davholla Linux - General 2 03-17-2005 09:29 AM
virtual hosting head scratcher di11rod Linux - Networking 2 06-09-2004 02:16 PM

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

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