Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-22-2012, 10:23 AM   #1
LQ Newbie
Registered: Aug 2006
Posts: 1

Rep: Reputation: 0
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
Old 08-22-2012, 01:27 PM   #2
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Slandrs, glad you found the solution but to save other peoples time from reading this over thinking you still need help you should select the "Mark this thread as solved" option from the "Thread Tools" drop down menu on the top of the thread.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Script to move/delete aged files ankitpandey Linux - General 6 01-27-2012 09:54 PM
Bash script to create sequential, numbered directories ericcarlson Linux - Software 4 01-08-2010 09:43 AM
script that create a blank file in all sub-directories. samengr Programming 8 02-18-2009 05:00 PM
Samba: "homes" share, cannot create directories, can create files Herg Linux - Software 1 09-14-2006 08:48 AM
Script to create multiple directories under users homes shawnbishop Linux - Software 4 03-30-2006 08:11 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:16 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration