PDA

View Full Version : cron jobs in gaia



archie100
2013-03-11, 19:06
Hi, I have upgraded my Smart Center to R75.40VS GAIA

I have added all my cronjobs using command "crontab -e" successfully. and crontab -l can display all the jobs
But, once I reboot smart Center all the jobs are gone and "crontab -l" is empty.

Any idea why this is happening?
cheers :)

northlandboy
2013-03-11, 19:29
Gaia is more like IPSO than SPLAT. Don't go editing all the different configs - do it through the central admin tools.

Look at pages 84-85 of the R75.40VS Gaia Administration Guide - you should be using either the WebUI, or "add cron job xxx" at the CLI.

archie100
2013-03-11, 19:32
GAIA or SPLAT does not allow to create jobs for less than a day using "add cron jobs" and it has the following SK77300, which is exactly what I have done but its not working.

https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk77300&js_peid=P-114a7bc3b09-10006&partition=Advanced&product=Security

northlandboy
2013-03-11, 20:29
I stand corrected. I don't see how that resolution could work though, if the configs are rebuilt at reboot.

internallamp
2013-03-12, 03:36
Did you just use

crontab -e
or did you use

crontab -u jobuser -e
as the SK states? I suspect the admin's crontab is the only one which is overwritten upon startup, hence the instructions to create a separate crontab to avoid this.

archie100
2013-03-12, 06:30
yes i did follow as per SK.
I created a user called 'cronuser'

add user jobuser uid 0 homedir /home/cronuser
save config

and then I used the following command "crontab -u cronuser -e" and added all the jobs in Expert mode
and after that when I reboot I can see all the jobs run as per schedule.

Its just that when I run command "crontab -l" its empty.

but when I use command "more /var/spool/cron/cronuser" all the jos are there and they run as per schedule.
I can also see the jobs using the following command "crontab -l -u cronuser"
I think its a normal behavior, as crontab -l will always look for jobs created by user "admin"

internallamp
2013-03-12, 06:44
Yes crontab without a -u <username> will show the currently logged in user's jobs. It sounds things are working as expected.