Hello János,

I see that you state your scp and ssh command line(s) run fine manually.

What happens when you run the whole shell script manually?  Does it (the
shell script) run?  If not, does it have execute permissions set?

Are you running your script as your UID?  Or as root?

Does your shell script need $PATH set from with in?

and finally, at the end of your cron line, you have this

> /dev/null 2>&1

which is great once you have all the bugs worked out.  I am sure you
knew that.  Have you tried sending STDOUT and STDERR to a file, vs. the
bit bucket to trouble shoot your script.

as far as the launchctl thing, I typically only use that for start up
items when the system is booting, or I am logging in as a user.  AFAIAK,
cron is where you need to be for repetitive system jobs.

Jerry


On 02/23/12 03:06 PM, János Löbb wrote:
> Folks,
> 
> I am sure I was sleeping at the wheel regarding this issue, so I need a hit 
> on my neck to the right direction.
> 
> I have this little crontab entry:
> bml0041:shell_script janos$ cat del_from_sequoia.crontab 
> 10 * * * * /Volumes/Data/PROJECTS/Sysmon/shell_script/del_from_sequoia.ksh > 
> /dev/null 2>&1
> 
> That is I want at 10 minutes after the hour to execute a shell script.
> 
> The script is this:
> 
> bml0041:shell_script janos$ cat del_from_sequoia.ksh
> #!/bin/bash
> #
> scp [email protected]:/prod2/ase15/sysmon/sysmonlogs/*.log 
> /Volumes/Data/PROJECTS/Sysmon/sysmsa/
> 
> ssh [email protected] "find /prod2/ase15/sysmon/sysmonlogs -name '*.log' | 
> xargs rm "
> 
> That is first I copy over some files from a remote server to my local machine 
> followed by deleting the files on the remote server.
> 
> If I do these two commends on the local machine at the CLI, both works fine.  
> However executing them via cron is a no go, that is nothing happens.
> 
> Now, I see in man crontab, that it wants me to use launchctl and I looked its 
> man page too, but I am not seeing how could I schedule the execution of this 
> script with launchd.
> 
> Thanks ahead,
> 
> János
> 

_______________________________________________
MacOSX-admin mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/macosx-admin

Reply via email to