using crontab to run workflow apps i've created?

kraylus

Registered
in windows i had task manager to schedule certain tasks at a specific time and at specified intervals. apple has this thing called automator (which i hear is only as of this past major release of the OS). i didnt get it at first, but after a few google sessions, i understood the dynamics and began creating helpful little workflows.

i then saved them as applications so they appear in my home dir as filename.app. i realized that that was where automator's usefulness stopped. i could specify a task, but not when and how often to run it. being a former linux advocate i remembered that nifty little tool, cron!

after some google'ing, i found an older post saying that it was indeed possible to run these *.app files using dcron or anacron. google'ed a refresher on simple crontabs and added this via crontab -e

0,30 * * * * /Users/myhomedir/RTdesktop.app
@hourly /Users/myhomedir/STdesktop.app

one changes the wallpaper and one takes a screenshot every 30min and sends it to my www folder. i saved the file and checked crontab -l and it showed me the two entries.

but... it's not working. is there some fundamental piece i've overlooked? i know that these workflows function properly as i've tested them thoroughly ;) awhile ago, i had one in my startup list to have a new wallpaper everytime i turned the machine on. so i KNOW that one works. i know that the path specified in the crontab is the path where those files exist. checked caps and everything. i'm at a roadblock.

any help is appreciated!

ryan
 
Applications aren't executable via a shell command since they are actually directories whose contents are layed out in a specific way, and which "look like" applications to the Finder.

Try using the open command to launch these applications:

Code:
30 * * * * open /Users/myhomedir/RTdesktop.app
@hourly open /Users/myhomedir/STdesktop.app
 
on closer inspection i come to find that the cli views these *.app files as folders (granted i knew that they were just big package of stuff, but figured you have to invoke a special... well, whatever). digging inside i figured out which piece you actually need to invoke with cron in order to run your workflow.

0,30 * * * * /Users/myhomedir/RTdesktop.app/Contents/MacOS/RTdesktop
@hourly /Users/myhomedir/STdesktop.app/Contents/MacOS/STdesktop

to test this, you can do

cd ~/STdesktop.app/Contents/MacOS/
./STdesktop

that will execute the program unix style.

so yay! it works! check it out!. updated every 30 min. 24/7/365.

hope this bit of info helps others,

ryan
 
Applications aren't executable via a shell command since they are actually directories whose contents are layed out in a specific way, and which "look like" applications to the Finder.

Try using the open command to launch these applications:

Code:
30 * * * * open /Users/myhomedir/RTdesktop.app
@hourly open /Users/myhomedir/STdesktop.app

oh hey, that works too. well hot damn! old school linux rekindled and i dont have to mess with making my own kernels to get my fancy hardware working. im so happy. money well spent.
 
Back
Top