Sponsored Content
Top Forums Shell Programming and Scripting How can i get last week files Post 302426867 by posix on Thursday 3rd of June 2010 06:36:45 AM
Old 06-03-2010
sorry , it's not help full for me
Code:
$ls -ltr
total 20
-rw-r--r-- 1 root root    0 May 18 23:15 jd15234
-rw-r--r-- 1 root root    0 May 19 23:15 je13795
-rw-r--r-- 1 root root    0 May 20 23:15 jkl
-rw-r--r-- 1 root root   29 May 21 00:20 rd11673
-rw-r--r-- 1 root root    0 May 21 23:15 ka12684
-rw-r--r-- 1 root root    0 May 22 23:15 kb27948
-rw-r--r-- 1 root root    0 May 23 23:15 kc27447
-rw-r--r-- 1 root root    0 May 24 23:15 kd31910
-rw-r--r-- 1 root root    0 May 25 23:15 ma6198
-rw-r--r-- 1 root root    0 May 26 23:15 mb21233
-rw-r--r-- 1 root root    0 May 27 23:15 mc2490
-rw-r--r-- 1 root root    0 May 28 23:15 md8924
-rw-r--r-- 1 root root    0 May 29 23:15 me9158

Date range is not the last week range..
Code:
$find . -daystart -mtime +6 -a -mtime -13 -exec ls -l {} \;
-rw-r--r-- 1 root root 0 May 24 23:15 ./kd31910
-rw-r--r-- 1 root root 0 May 26 23:15 ./mb21233
-rw-r--r-- 1 root root 0 May 23 23:15 ./kc27447
-rw-r--r-- 1 root root 0 May 22 23:15 ./xyz/af
-rw-r--r-- 1 root root 0 May 22 23:15 ./kb27948
-rw-r--r-- 1 root root 0 May 27 23:15 ./mc2490
-rw-r--r-- 1 root root 0 May 25 23:15 ./ma6198

Is there any method to track the weekly records?
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

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... (1 Reply)
Discussion started by: csaha
1 Replies

2. Shell Programming and Scripting

Get Files from ftp which are uploaded recent week

Hi All, Here is a brief scenario for my requirement .. There is a directory in FTP Server, where would files be uploaded on weekly basic. I need to get those files which are uploaded during this week and not the files which are uploaded the previous week and download them to locale... (1 Reply)
Discussion started by: narramadan
1 Replies

3. Shell Programming and Scripting

Removing files older than one week in a directory

Hi, I need a shell script to remove the files older than a week in a directoy and if necessary to zip the files. (2 Replies)
Discussion started by: sudhakaryadav
2 Replies

4. UNIX for Dummies Questions & Answers

crontab every other week

I have two sets of tapes for each week days. Mon_Set_A ____________Tue_Set_B Tue_Set_A ____________ Tue_Set_B Wed_Set_A ___________ Wed_Set_B Thr_Set_A ____________ Thr_Set_B Fri_Set_A _____________ Fri_Set_B I have script that does cold backup of database and then back up to tape. ... (1 Reply)
Discussion started by: Paul.S
1 Replies

5. UNIX for Dummies Questions & Answers

Number of files accessed this week

I have looked around on the internet and still i am no wiser as to how to show the number of files in a directory that have been accessed this week and also that as a percentage. Any help would be much appreciated. (5 Replies)
Discussion started by: RAFC_99
5 Replies

6. UNIX for Advanced & Expert Users

How to pick only current week files?

Hi, My job will run every friday and it should pick only that week files. For Ex: this 24th May job will trigger and it should pick 20,21,22,23,24.and 19th sun and 18th sat we dont have files to pick. currently i am using the below code and it is working fine, but sometimes it is picking... (3 Replies)
Discussion started by: kiranparsha
3 Replies

7. Shell Programming and Scripting

Need help deleting files one week older

Hi, I need to delete *.bad files which are 1 week old. How can I achieve that. I tried doing through below script but it deletes all the files. find ./ -mtime +7 -exec rm *.bad {} \; The below one works but i want to delete only files with .bad extension find . -mtime +7 | xargs rm (2 Replies)
Discussion started by: Gangadhar Reddy
2 Replies

8. Linux

Get all the files from a FTP location with previous week's dates in the file names using Linux

I have a weird requirement where I have to get the files from a FTP(Lets say FTP1) location and place it on my current FTP(Lets say FTP2) location. The issue is, these are daily files (in a pattern Sales_YYYYMMDD_report.csv) and are placed every day on FTP1 and my process usually runs on Monday(eg.... (2 Replies)
Discussion started by: dhruuv369
2 Replies
SYSTEMD-VOLATILE-ROOT.SERVICE(8)			   systemd-volatile-root.service			  SYSTEMD-VOLATILE-ROOT.SERVICE(8)

NAME
systemd-volatile-root.service, systemd-volatile-root - Make the root file system volatile SYNOPSIS
systemd-volatile-root.service /lib/systemd/systemd-volatile-root DESCRIPTION
systemd-volatile-root.service is a service that replaces the root directory with a volatile memory file system ("tmpfs"), mounting the original (non-volatile) /usr inside it read-only. This way, vendor data from /usr is available as usual, but all configuration data in /etc, all state data in /var and all other resources stored directly under the root directory are reset on boot and lost at shutdown, enabling fully stateless systems. This service is only enabled if full volatile mode is selected, for example by specifying "systemd.volatile=yes" on the kernel command line. This service runs only in the initial RAM disk ("initrd"), before the system transitions to the host's root directory. Note that this service is not used if "systemd.volatile=state" is used, as in that mode the root directory is non-volatile. SEE ALSO
systemd(1), systemd-fstab-generator(8), kernel-command-line(7) systemd 237 SYSTEMD-VOLATILE-ROOT.SERVICE(8)
All times are GMT -4. The time now is 11:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy