CPUG

The Check Point User Group

A Resource For The Check Point Community.  Fast.  Useful.  Independent.

1. CCSA/CCSE One-Week Dual-Certification Training Course with CPUG in San Francisco!
    Courses Starting 12/8, (2009) 1/19, 2/9, 3/9, 4/6, 5/4, 6/8, 7/6, 8/3.
2. Join Us On LinkedIn - We now have a CPUG group.


Go Back   CPUG: The Check Point User Group > Check Point Firewall-1/VPN-1 Platforms > Linux
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2008-04-30
Member
 
Join Date: 2007-05-18
Posts: 43
Rep Power: 0
longhill has an average reputation (10+)
Default automatic upgrade_export

I want automatic upgrade_export.

[Expert@MNGFW01]# crontab -e:


50 12 * * * cd /opt/CPsuite-R62/fw1/bin/upgrade_tools
51 12 * * * echo | ./upgrade_export appoggio
25 13 * * * oggi=`date`
26 13 * * * mv appoggio.tgz.tar $oggi
27 13 * * * scp $oggi r...@172.28.121.16:/data/backup_2008


[Expert@MNGFW01]# less /var/log/cron


Apr 30 12:50:00 MNGFW01 CROND[22798]: (root) CMD (cd /opt/CPsuite-R62/
fw1/bin/upgrade_tools)
Apr 30 12:51:00 MNGFW01 CROND[22806]: (root) CMD (echo | ./
upgrade_export appoggio)
Apr 30 12:52:24 MNGFW01 crontab[22820]: (root) LIST (root)
Apr 30 12:53:19 MNGFW01 crontab[22821]: (root) LIST (root)
Apr 30 12:54:14 MNGFW01 crontab[22827]: (root) BEGIN EDIT (root)
Apr 30 12:54:26 MNGFW01 crontab[22827]: (root) END EDIT (root)
Apr 30 13:25:00 MNGFW01 CROND[22966]: (root) CMD (oggi=`date`)
Apr 30 13:25:54 MNGFW01 crontab[22972]: (root) LIST (root)
Apr 30 13:26:00 MNGFW01 CROND[22974]: (root) CMD (mv appoggio.tgz.tar
$oggi)
Apr 30 13:27:00 MNGFW01 CROND[22980]: (root) CMD (scp $oggi
r...@172.28.121.16:/data/backup_2008 )
Apr 30 13:28:30 MNGFW01 crontab[22988]: (root) LIST (root)
Apr 30 13:29:30 MNGFW01 crontab[22997]: (root) BEGIN EDIT (root)
Apr 30 13:30:05 MNGFW01 crontab[22997]: (root) END EDIT (root)


If I run commands without crontab all ok!
With crontab run upgrade_export but does not create anything!


What happens?
Where is the error?
Reply With Quote
  #2 (permalink)  
Old 2008-04-30
Junior Member
 
Join Date: 2007-04-13
Posts: 2
Rep Power: 0
decnartne has an average reputation (10+)
Default Re: automatic upgrade_export

cron does not maintain the "context" across multiple entries like your shell (bash/sh/etc.) does. Your best bet is to put all of those commands into a new script file and run that new script from cron. (make sure the new script is executable)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -7. The time now is 09:45.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0