Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Nandhakumar
Contributor

Scheduled Cronjob failed to Survive reboot

Hi,

I have created script to take configuration backup of security gateways on monthly basis by cron job. What happened one of the gateway rebooted, post that I am unable to see the scheduled job in crontab, it got auto vanished.

Kindly help me to fix this issue. Cron job should survive reboot.

 

0 Kudos
6 Replies
mcatanzaro
Employee
Employee

Hi Nandhakumar,

Are you manually editing crontab to accomplish this?

Any reason why you can't use either the gaia webui or the clish "add/set backup-scheduled" commands instead?

These methods will update crontab accordingly.

Also see job scheduler: https://sc1.checkpoint.com/documents/R81/WebAdminGuides/EN/CP_R81_Gaia_AdminGuide/Topics-GAG/Job-Sch...

 

0 Kudos
Nandhakumar
Contributor

Hi Mcatanzaro,

My requirement is to take only firewall configuration backup "show configuration". So I wouldn't use system backup for that.

 

Yes, I created script (backupscript.sh) in /home/admin directory and used in crontab. 

I edited crontab with below line.

20 06 7 * * /home/admin/backupscript.sh

Assigned full permission to the script file. User is admin, who is executing the script having full rights.

Only problem was that crontab entry got removed automatically if gateway reboots.

I tried to use job scheduler but it doesn't have option to transfer file to FTP server. It has only option to send output to email.

0 Kudos
mcatanzaro
Employee
Employee

Thanks for the additional info.

Please note that the system backup does only backup configuration settings. I would recommend using that method if you are trying to use this backup as a way to restore from a failure or other issue.

It's not recommended to manually edit the crontab file on gaia. Job scheduler would be the best option if you still wish to use your script. You should be able to script the ability to upload to your external server.

0 Kudos
Nandhakumar
Contributor

Thanks, I am able to schedule job using job scheduler and it survives reboot.

Just one question.. Does the scheduled job will be in place even if I upgrade/hotfix gateway? I know it will gone if i do fresh install but just want to know how it behaves after upgrade or patch?

0 Kudos
G_W_Albrecht
Legend
Legend

As this is GAiA OS config it should not be removed by a Jumbo or other Hotfix. It should also survive any in-place-upgrade - but you better always check after upgrade to be secure 😎

CCSE CCTE CCSM SMB Specialist
0 Kudos
Nandhakumar
Contributor

Verified that it survives reboot as well as in place upgrade. Thanks.

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    Tue 23 Apr 2024 @ 11:00 AM (EDT)

    East US: What's New in R82

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82

    Tue 23 Apr 2024 @ 11:00 AM (EDT)

    East US: What's New in R82

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82
    CheckMates Events