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 the last week file also i.e 17th which results duplicates.

ssh tr_ap@apalyn /usr/bin/find '/apps/trav/decrypt/archive/ApprovedReports*' -mtime -7

Please let me know is there any other way to pick only that week files.
Thanks in advance.
Kiran

Try:

ssh tr_ap@apalyn /usr/bin/find '/apps/trav/decrypt/archive/ApprovedReports*' -daystart -mtime -7

Hi ,

i executed now using the below code , but it took last week files 16,17,20,21.It should take only 20 and 21st. Please let me know if this code works only on fridays.

ssh tr_ap@apalyn /usr/bin/find '/apps/trav/decrypt/archive/ApprovedReports*' -daystart -mtime -7

Yes, it works only on Fridays.

1 Like