[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [FW-1] Running Cron job on Secure Platform AI
How do you restore this? Regards, Dirk Udo Interpay Nederland B.V. Security Management Tel: +31 (0)20 5631 (8)568 E-mail: [email protected] -----Oorspronkelijk bericht----- Van: [email protected] [mailto:[email protected]] Verzonden: vrijdag 3 oktober 2003 17:14 Aan: [email protected] Onderwerp: Re: [FW-1] Running Cron job on Secure Platform AI Thanks to everyone who sent their assistance. In the end, I just added the CP.sh script to the top of my script (as was one of the suggestions) and everything is working great. Thanks again. Rick -----Original Message----- From: Sid Van den Heede [mailto:[email protected]] Sent: Thursday, October 02, 2003 9:58 AM To: Mailing list for discussion of Firewall-1; Rick Hislop Subject: Re: [FW-1] Running Cron job on Secure Platform AI On Thu, 2003-10-02 at 11:56, [email protected] wrote: > Hi all, > I have an issue trying to run a backup script on NG w/ AI Secure > Platform. When the script is run manually (from the shell) and it runs > fine. When it is run via cron, it fails. From what I can tell, the > environment variables are not active in the context of cron and when > the script tries to run backup_start (backup command) it doesn't know > where anything is. I've attached the script as well as some errors in > various logs. Your help is greatly appreciated ... > ** From /var/log/messages log ** > Sep 30 23:59:00 ptcfw1 CROND[21462]: (root) CMD > (/etc/init.d/cp_backup.sh) > Sep 30 23:59:00 ptcfw1 CronDaemon: Cron <root@ptcfw1> > /etc/init.d/cp_backup.sh (Environm > ent: <SHELL=/bin/sh>, <HOME=/root>, <PATH=/usr/bin:/bin>, > <LOGNAME=root>) : /etc/init.d/ > cp_backup.sh: cpstop: command not found Your PATH doesn't include the Check Point directories, just /usr/bin and /bin. > ** Backup Script ** > > #! /bin/bash > CPDATE=`date +%m%d%y-%H%M` > LOGSERVER="IP of log server" > CPLOG=/var/cplog/CPBACKUP.LOG > CPTEMP=/tmp/cptemp.log > > # Stop firewall services > cpstop Any script that is to be run by a user with elevated privileges should set PATH explicitly. You could do that, hard coding the directories that contain the appropriate Check Point commands, but that changes from one FP to the next. I'm going to assume Linux here. The details will be slightly different under Solaris or other OS. When CP was installed, it created a file called /etc/profile.d/CP.sh. When you login, that script is run along with many others. CP.sh updates your PATH and sets other environment variables. You could just run that script at the start of your script, like so: . /etc/profile.d/CP.sh The initial dot is an essential part of the command line (indeed, it is the command). Without it, the script will run in a subshell, which will exit before your script continues. The net effect on your script's environment would be nil. BTW, you should put your script into something like /usr/local/bin or /usr/local/sbin, not /etc/init.d. That is for init scripts. ================================================= To set vacation, Out-Of-Office, or away messages, send an email to [email protected] in the BODY of the email add: set fw-1-mailinglist nomail ================================================= To unsubscribe from this mailing list, please see the instructions at http://www.checkpoint.com/services/mailing.html ================================================= If you have any questions on how to change your subscription options, email [email protected] ================================================= ------------------------------------------------------------------------------------------------ Disclaimer: ' Aan de inhoud van dit bericht kunnen alleen rechten ten opzichte van Interpay Nederland B.V. of aan haar gelieerde ondernemingen worden ontleend, indien zij door rechtsgeldig ondertekende stukken worden ondersteund. De informatie in dit e-mailbericht is van vertrouwelijke aard en alleen bedoeld voor gebruik door de geadresseerde. Als u een bericht onbedoeld heeft ontvangen, wordt u verzocht de verzender hiervan in kennis te stellen en het bericht te vernietigen zonder van de inhoud kennis te nemen, deze te vermenigvuldigen of andersoortig te gebruiken.' An English version of this disclaimer is available on http://www.interpay.nl/disclaimerenglish ------------------------------------------------------------------------------------------------ ================================================= To set vacation, Out-Of-Office, or away messages, send an email to [email protected] in the BODY of the email add: set fw-1-mailinglist nomail ================================================= To unsubscribe from this mailing list, please see the instructions at http://www.checkpoint.com/services/mailing.html ================================================= If you have any questions on how to change your subscription options, email [email protected] =================================================
|