Associate
- Joined
- 19 Jun 2003
- Posts
- 1,680
- Location
- West Yorks, UK
Hi all,
I have an FTP directory in which files are continuously uploaded each day (say around 40 or so). They all have the same filename structure, e.g.:
Basically, the first 4 characters group the files (there are "dep" and "par" files, with numbers from 1-3). The remaining characters after the underscore are the date and time the file was generated, in reverse format (so the example above is 28/02/2007 8:58:45am).
I want to have a cron task that runs every night to bunch any files that are 7 days or older into a .zip file for that date. So, i would end up with the following:
etc etc....
How can I achieve this with standard Linux commands?
Cheers,
Matt
I have an FTP directory in which files are continuously uploaded each day (say around 40 or so). They all have the same filename structure, e.g.:
Code:
dep1_20070228085845.csv
Basically, the first 4 characters group the files (there are "dep" and "par" files, with numbers from 1-3). The remaining characters after the underscore are the date and time the file was generated, in reverse format (so the example above is 28/02/2007 8:58:45am).
I want to have a cron task that runs every night to bunch any files that are 7 days or older into a .zip file for that date. So, i would end up with the following:
Code:
dep1_2007-02-28.zip
par2_2007-02-28.zip
dep1_2007-02-27.zip
How can I achieve this with standard Linux commands?
Cheers,
Matt