Visit Our UNIX and Linux User Community


How to identify week-1 and week-2


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to identify week-1 and week-2
# 1  
Old 02-16-2006
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
# 2  
Old 02-16-2006
KISS
what about,
Code:
rm week3
mv week2 week3
mv week1 week2
backup > week1

Then you don't need to keep track?

Previous Thread | Next Thread
Test Your Knowledge in Computers #839
Difficulty: Medium
WebSocket is a computer communications protocol, providing half-duplex communication channels over a single TCP connection.
True or False?

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Get the week's day

Hi All, I have the below requirement , if i give the week number for ex 41 i need to get the date for Monday and thursday for this given week. my expected output is 13/10/2014 (Monday's date) and 16/10/2014 (Thursday's date) I am using GNU LINUX . Pls help me with your thoughts. Thanks in... (7 Replies)
Discussion started by: mohanalakshmi
7 Replies

2. Shell Programming and Scripting

How can i get last week files

Hi, Is it possible to get all the files modified in the last week (Not before or after that week) . I have tried with date range it works for me for the period of seven days , not exactly for weekly basis . Fetching records for seven day by find -mtime +6 -a -mtime -13As today date is 3rd... (5 Replies)
Discussion started by: posix
5 Replies

3. Shell Programming and Scripting

need help to get last week date

Hi, How to get last week date ? Normally i use this command : But somehow this not working in SunOS And i try use this : But in SunOS only working only get last 6 days Cheers, (1 Reply)
Discussion started by: justbow
1 Replies

4. UNIX for Dummies Questions & Answers

week number

how can I display week number using 'date' command. ?? in the manual it says " %w day of week (0..6); 0 is Sunday" I did not get it? help please. Alice (2 Replies)
Discussion started by: alisevA3
2 Replies

5. UNIX for Dummies Questions & Answers

Every week one dir - How to

I need to make programmatically one dir every week Saturday, like 102106, 102806, ... 10 ==> month 21 ==> Saturdays 06 ==>Yr Any idea? (1 Reply)
Discussion started by: redlotus72
1 Replies

6. Shell Programming and Scripting

Getting week in month.???

Hi All, I have a tricky problem. I need to write a shell script (bash) which identifies which week off the month it is. I need to create a partition each week. So for the first week (where first of the week is Monday) of March i want to create partition_march_01 and for the second partition... (1 Reply)
Discussion started by: Zak
1 Replies

Featured Tech Videos