Making folders on a daily basis...

R

rbaibich

Guest
I'm setting up a network for an independent news show, and they use the same folder structure for every show. Right now the whole thing is being done manually, but I'd like to make some sort of script to make those folders every weekday in the early morning.

Is there a way of doing that?
 
Joined
Jan 8, 2005
Messages
6,188
Reaction score
254
Points
83
Location
New Jersey
Your Mac's Specs
Mac Pro 8x3.0ghz 12gb ram 8800GT , MBP 2.16 2GB Ram 17 inch.
Probably could have it run on start up, Making a script with apple script, something like it checks the date then checks to see if its a week day.. then makes the folders. Idk not really a progammer just trying to offer some assistance. Sorry if what i said was pointless, just trying to help, lol
 
OP
K

Kokopelli

Guest
Yes you can set up a cron job. If you are on Tiger would use launchd I suppose instead of cron but it is the same idea. I do not know how to configure launchd though.

Rather than try and explain it here I would suggest doing a google for "cron tutorial OS X" and see if you can make sense of that. If not come back and one of us should be able to give you pointers.

Here are two quick links I found (I dod not read either in detail)

http://www.macdevcenter.com/pub/a/mac/2002/07/02/terminal_5.html?page=2

http://www.macosxhints.com/article.php?story=2001020700163714
 
Joined
May 22, 2005
Messages
2,159
Reaction score
67
Points
48
Location
Closer than you think.
Your Mac's Specs
Performa 6116 2GBSCSI 8MB OS 7.5.3
Scripting would be the way to go, however I am too lazy to dig into AS. If this helps you try it.

If there is no need for dates, or you only change the top level. Set up the folder structure once and then at the top level ctrl click it and select create archive. This will zip the folders in their structure to be unzipped anytime.

Now that's lazy!
 
Joined
Jan 8, 2005
Messages
6,188
Reaction score
254
Points
83
Location
New Jersey
Your Mac's Specs
Mac Pro 8x3.0ghz 12gb ram 8800GT , MBP 2.16 2GB Ram 17 inch.
MacsWork said:
Scripting would be the way to go, however I am too lazy to dig into AS. If this helps you try it.

If there is no need for dates, or you only change the top level. Set up the folder structure once and then at the top level ctrl click it and select create archive. This will zip the folders in their structure to be unzipped anytime.

Now that's lazy!

lol yeah... something I would do, but its not automatic.
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
I know you might be able to AppleAcript or even Automater. But creating a shell script and running it as a cron job would most likely be easier.

If the folder are created every Monday then cron can run the script on Monday for you. All you would need to is record the steps you do in a file.

What is the folder structure?
 
OP
R

rbaibich

Guest
rman said:
What is the folder structure?

06-14-2005
06-14-2005/texts
06-14-2005/images
06-14-2005/video
06-14-2005/etc

I'm using Tiger. I have some experience with Linux, so that should help me with the shell scripting job. I hope.
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
Here is an example of a possible shell script.

dte=`date "+ %m-%d-%y"`
mkdir -p $dte $dte/texts $dte/images $dte/video $dte/etc

Then you would need to place an entry in the crontab file to run your script once a week at certain time.
 
OP
K

Kokopelli

Guest
rman said:
Here is an example of a possible shell script.

dte=`date "+ %m-%d-%y"`
mkdir -p $dte $dte/texts $dte/images $dte/video $dte/etc

Then you would need to place an entry in the crontab file to run your script once a week at certain time.


Minor quibble but I think it should be

dte=`date "+ %m-%d-%C%y"`

since he wants a 4 digit year.
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
I looked over the 4 digit year. Thanks for the correction.
 
Joined
Jan 8, 2005
Messages
6,188
Reaction score
254
Points
83
Location
New Jersey
Your Mac's Specs
Mac Pro 8x3.0ghz 12gb ram 8800GT , MBP 2.16 2GB Ram 17 inch.
am i suppose to see a difference in what kokopelli and rman wrote
 
OP
K

Kokopelli

Guest
PowerBookG4 said:
am i suppose to see a difference in what kokopelli and rman wrote

The %C, used to designate the 2 digit century in the date string.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top