Advertisement

04.14.2005 at 12:12PM PDT, ID: 21389310
[x]
Attachment Details

shell script for moving folders within a directory older than 30 days to another directory

Asked by dareach in General Macintosh Programming

Tags: script, shell, directory, move, folder

i need a script that i can have cron run everyday, to move folders within a directory with a date of more than 30 days to another directory.

its important that the script only looks at the folder dates and not whats inside because it will start moving files out of the folders.

i want to keep the amount of orders in our order folder down to increase performance

should look something like this:

find /path/to/orderfolder -d -mtime +30 -exec mv -f {} /path/to/archivefolder \;

i get this response:
find: -d: unknown expression primary

Start Free Trial
[+][-]04.14.2005 at 11:03PM PDT, ID: 13788370

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 07:24AM PDT, ID: 13790968

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 07:41AM PDT, ID: 13791151

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.15.2005 at 08:44AM PDT, ID: 13791797

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: General Macintosh Programming
Tags: script, shell, directory, move, folder
Sign Up Now!
Solution Provided By: brettmjohnson
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.17.2005 at 04:02PM PDT, ID: 13802760

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32