halp!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting halp!
# 1  
Old 06-12-2009
Need help with something hopefully simple in SH

Hello. I am in need of help writing a shell script because I'm an idiot. Actually I'm just new to this. I need it to do the following:
- run once a day
- remove all files in 10 different directories that are more than ___ days old.
- take the remaining files in those 10 directories and add them to subdirectories within them that are named based on the date. For ex: files created on June 10th, 2009 would go into a subdirectory in each main directory called 06-10-2009, etc.

Any ideas from you fine people?
I thank you in advance.

Rip

Last edited by riproar; 06-12-2009 at 12:45 AM.. Reason: title is apparently against rules
# 2  
Old 06-12-2009
Quote:
Originally Posted by riproar
- run once a day -- try cron
- remove all files in 10 different directories that are more than ___ days old. try find with -atime
- take the remaining files in those 10 directories and add them to subdirectories within them that are named based on the date. For ex: files created on June 10th, 2009 would go into a subdirectory in each main directory called 06-10-2009, etc. try find

Any ideas from you fine people?
I thank you in advance.

Rip
First try this and then ask for more help. go thru' man pages for additional help.
Please change the subject, this one is against the forum rules. Thanks,
# 3  
Old 06-12-2009
Hello,

Per our forum rules, all threads must have a descriptive subject text. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt". Post subjects like "Execution Problems with Cron" or "Help with Backup Shell Script".

The reason for this is that nearly 95% of all visitors to this site come here because they are referred by a search engine. In order for future searches on your post (with answers) to work well, the subject field must be something useful and related to the problem!

In addition, current forum users who are kind enough to answer questions should be able to understand the essence of your query at first glance.

So, as a benefit and courtesy to current and future knowledge seekers, please be careful with your subject text. You might receive a forum infraction if you don't pay attention to this.

Thank you.

The UNIX and Linux Forums
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question