Results 1 to 2 of 2
Hi All
I was hoping to find out if its possible to zip file by the date and time it was created.
e.g file format
xxxx_xx_15278.log.2008-04-24 created on 24/04/2008 05:35:00
...
- 05-22-2008 #1Just Joined!
- Join Date
- May 2008
- Posts
- 1
Zipping File script by Date of creation
Hi All
I was hoping to find out if its possible to zip file by the date and time it was created.
e.g file format
xxxx_xx_15278.log.2008-04-24 created on 24/04/2008 05:35:00
what i like to do is it would check the time and date then zip the file then zip three more files above the first file.
I do understand programming but not to advance level so any help is most welcomed.
Thanks
- 05-23-2008 #2Just Joined!
- Join Date
- Jul 2007
- Posts
- 49
You could use something along the lines of this
this would zip all the files from the file location with the word log somewhere in the name which has not been modified in the last 60 mins, there are more options you could use it would be worth taking a look at the man page for find for all the available options.Code:find /location -name "*log*" -mmin +60 -exec gzip {} \;
Just be careful when using this as you could accidentally zip something you shouldn't.


Reply With Quote