The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Get Day of Week from date vpapaiya HP-UX 5 03-07-2008 01:47 PM
week number alisevA3 UNIX for Dummies Questions & Answers 2 10-31-2007 02:01 AM
Every week one dir - How to redlotus72 UNIX for Dummies Questions & Answers 1 10-17-2006 12:54 AM
Changing First Day Of The Week? fowlerleftfoot UNIX for Dummies Questions & Answers 2 08-28-2006 07:16 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-15-2006
csaha's Avatar
Registered User
 

Join Date: Feb 2005
Posts: 81
How to identify week-1 and week-2

Hello Friends

I have three dirs

1. /home/main-bkup
2. /home/bkup-week1
3. /home/bkup-week2

Now we copy backups in 1 initially, then on 1st week we copy few content of 1 into 2 and then run some scripts on that. Then in 2nd week we keep 2 untouched and do the same thing in 3.

So I need to identify the way in my script to tell the script which shound be considered as week1 and which is week2. For simplicity say if this week (week of FEB 12 to FEB 18) is 1st week then next week (week of FEB 19 to FEB 25) will be week2. And after that week 1 will come back again, and so on ...

Now how should I tell the script to identify which is week 1 and week 2 and then week 1 again, so on ...

Ideas please ...

Thanks a lot to all in advance
C Saha
Reply With Quote
Forum Sponsor
  #2  
Old 02-16-2006
Registered User
 

Join Date: Feb 2006
Location: Southern England
Posts: 102
KISS
what about,
Code:
rm week3
mv week2 week3
mv week1 week2
backup > week1
Then you don't need to keep track?
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:02 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0