Command or script to create aged test directories and files.
I need to create directories and files with aging that can be listed via "find /tmp -mtime 99 ..." command to test housekeeping and reporting automation.
Is there a touch or similar command or script that I can use on a directory or file to advance the age of the object for the above find command to detect? I need to create objects of dates on either side of the find -mtime option to prove correct filtering.
I also need to implement an exclude file to prevent the find command from listing unintended filesystem content.
Thanks, Steve
I found my solution in: touch -c -t 04050607 t;ls -l;pwd
The find command will locate it as being an aged file of greater than 111 days old.
Last edited by slandrs; 08-22-2012 at 12:42 PM.
Reason: Found solution
|