Re: cron log file location
You write "your crontab", but surely a mount command requires root privilege?
Re: cron log file location
All my servers i use this line and works fine.
@reboot sleep 10; mount -a -t cifs; //Works to mount my samba shares
FYI my version is 10.3
Re: cron log file location
I assume you put that in root's crontab. I think such a command is inherently unreliable because you cannot guarantee that the network is up 10 seconds after the cron daemon is started. The startup of the cron daemon may be totally unrelated to the startup of the network.
Instead you should let the service smbfs do it, that's what this init script is designed for, instead of cobbling your own. This script is sequenced after network. You should be able to turn on this service from YaST. And you need a cifs entry in fstab of course.
Re: cron log file location
Cool. I edited my crontab as root. Will check for this service on Yast and yes i For now this command works to me. My problem is on red lines of cron. Do u know where is the log file?
Thanks for prompt replies!:)
Re: cron log file location
Normally the common syslog destination: /var/log/messages. But it doesn't contain any output from the command, only when a job was started. Output from cron jobs normally gets emailed to root.
You could do this to capture the output:
Code:
00 23 * * * /usr/local/groovy-1.5.6/bin/groovy /mnt/ecmsrv/u/redes/scripts/groovy/backupGeral.groovy > /tmp/debug.out 2>&1
As for the groovy lines, a cron environment is missing some things compared with a login environment. The PATH is much reduced and if your script makes assumptions about the PATH, some commands will not be found.
Re: cron log file location
I checked the /var/log/messages and could see that the commands are been executed normaly. The problem is on JAVA_HOME PATH when the command run. will create an script that sets the path for java and after run the groovy commands. thanks for your help. Later i post here the results!
Re: cron log file location
You can do it inline in the crontab:
00 23 * * * JAVA_HOME=/somedir/somewhere /usr/local/groovy-1.5.6/bin/groovy /mnt/ecmsrv/u/redes/scripts/groovy/backupGeral.groovy
It's not special to crontabs, it's part of the shell. You can set environment variables for the duration of a command in the shell using that notation, for example:
$ JAVA_HOME=/alternatedir/somewhere some-java-program
works to change JAVA_HOME temporarily for that command.
Re: cron log file location
Hi again.
It works fine now.Ty for your tips!
;)
Re: cron log file location
I cant find my cron task in /var/log/messages and I know it was executed as I verified process list and it was running.
How do I see log when this task started?