CPUG

The Check Point User Group

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

1. Come to CPUG CON 2008 EUROPE in Switzerland on September 8th - 9th!
    Two days full of technical content for Check Point administrators in the beautiful Swiss Alps!
    We already have 52 attendees signed up from 14 countries!
2. CCSA/CCSE One-Week Dual-Certification Training Course with CPUG in San Francisco!
    Courses Starting 8/25, 10/6, 11/3, 12/8, (2009) 1/19, 2/9, 3/9, 4/6, 5/4, 6/8, 7/6, 8/3, 9/7.
3. Corrent S3500 SecureXL Turbocards For Sale - Last Six Remaining - Get Your Spares!
4. Join Us On LinkedIn - We now have a CPUG group.


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

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2007-10-12
slands10 slands10 is offline
Junior Member
 
Join Date: 2007-10-11
Posts: 8
Rep Power: 0
slands10 has an average reputation (10+)
Default Automating upgrade_export

Hi folks,
I've been researching a solution to automate the upgrade_export utility on Windows so we can take frequent backups for the CS config and all the associated bits and bobs. There is a fair amount of information relating to how to use batch files etc, but something that I have yet to find is anyone mentioning the need to stop all the services on the Management Server prior to running the utility, I was under the impression that this was a requirement for the utility to complete successfully as per the CP manual?
Can anyone give a definitive answer? Many thanks!
Reply With Quote
  #2 (permalink)  
Old 2007-10-12
mcnallym mcnallym is offline
Senior Member
 
Join Date: 2007-06-04
Posts: 983
Rep Power: 2
mcnallym has an average reputation (10+)
Default Re: Automating upgrade_export

You DONT haveto stop the services at all. I have upgrade_export many boxes fine without stopping the services. It is just a recommendation to do if your export fails to execute propertly. I have certainly never read in the manual that you must stop them.

If you have found the article that explains the removing the need to press any key to continue then you are there anyway.

If you want to stop and start the Check Point Services, how hard is it to add cpstop and cpstart into the batch file

upgrade_export -n will resolve the press any key issue

so something like

cpstop
upgrade_export -n
cpstart

should do in a batch file. Then use Windows Scheduler to automate running the batch file.
Reply With Quote
  #3 (permalink)  
Old 2007-10-12
slands10 slands10 is offline
Junior Member
 
Join Date: 2007-10-11
Posts: 8
Rep Power: 0
slands10 has an average reputation (10+)
Default Re: Automating upgrade_export

Hi, thanks for your response. I have defiantly read that the services related to the Management Clients should be stopped, however this may be to prevent users remotely accessing whilst the utility runs - I can't find the document I read it in! Didn't want to assume that it'd be OK to export the config with the services running.
Anyhoo, cheers again, will report back :)
Reply With Quote
  #4 (permalink)  
Old 2007-10-12
chillyjim chillyjim is offline
Senior Member
 
Join Date: 2005-08-29
Location: Upstate NY
Posts: 1,627
Rep Power: 5
chillyjim has an average reputation (10+)
Send a message via AIM to chillyjim Send a message via Skype™ to chillyjim
Default Re: Automating upgrade_export

GUI clients should be disconnected, but ohterwise you can do an export live.
Reply With Quote
  #5 (permalink)  
Old 2007-11-12
slands10 slands10 is offline
Junior Member
 
Join Date: 2007-10-11
Posts: 8
Rep Power: 0
slands10 has an average reputation (10+)
Default Re: Automating upgrade_export

Hi all,
Thanks for the help when I requested it. Just for completeness, and incase anyone is looking for a script for backing up with upgrade_export, here is how I did it, using Cygwin for mapping drives while no user is logged in to the management workstation. I used several different scripts as troubleshooting is far easier.

Process:
Call Backup.bat - to map drive using Cygwin
Run upgrade_export
Call date parameters
Rename CP backup file with the days date
Move the renamed file to the mapped drive
Disconnect the mapped drive

(note:
all CP services are still running - this is done when there is little / no change someone will be using the GUI)




------------------------------------------------------------------
CPBackup.bat:
call C:\Backups\backup.bat

echo | C:\CPBackup\upgrade_export.exe /CPBackup/CP_backup.tgz **(this line works - the echo passes a C.R.)

for /f "tokens=1,2,3 delims=/ " %%i in ('date/t') do (
(set Dy=%%i)
(set Mth=%%j)
(set Yr=%%k)
)
rename *.tgz "CPBackup_%Dy%%Mth%%Yr%.tgz"


move CPBackup_%Dy%%Mth%%Yr%.tgz L:\Archive\CPBackup
call C:\Backups\FinishBackup.bat

---------------------------------------------------------------------

Backup.bat:
C:\cygwin\bin\bash C:\backups\backup.sh %1%

---------------------------------------------------------------------

backup.sh:
PATH="/usr/local/bin:/usr/bin:/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT"
# Mount the L: drive
net use L: /delete /yes
net use L: '/USER:SERVER\myusername' /PERSISTENT:YES '\\mappeddrive\myfolder' 'mypassword'

-----------------------------------------------------------------------
FinishBackup.bat
E:\cygwin\bin\bash E:\backups\FinishBackup.sh %1%

-----------------------------------------------------------------------
FinishBackup.sh
PATH="/usr/local/bin:/usr/bin:/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT"
# Dismount the L: drive
net use L: /delete /yes

Last edited by slands10; 2007-11-12 at 03:18. Reason: Add more info
Reply With Quote
  #6 (permalink)  
Old 2007-11-13
Thorpuse Thorpuse is offline
Senior Member
 
Join Date: 2007-07-16
Posts: 447
Rep Power: 2
Thorpuse has an average reputation (10+)
Default Re: Automating upgrade_export

Nice scripts, but as I've mentioned in other threads, you need to ensure that GUI clients are disconnected, and there's no way of doing this at command-line unless you run cpstop (Although, it *can* be done. Just CP won't reveal how and seem to not notice the RFE's for this....).

If the GUI clients are connected, any files that are open or in a locked state don't get copied properly. This can be disastrous for when you try and restore, and trust me, a disaster situation is NOT when you want to find out about this.

C'mon Check Point, tell us the command that powers that magical "Disconnect Client" button in SmartView Monitor?
Reply With Quote
  #7 (permalink)  
Old 2007-11-13
slands10 slands10 is offline
Junior Member
 
Join Date: 2007-10-11
Posts: 8
Rep Power: 0
slands10 has an average reputation (10+)
Default Re: Automating upgrade_export

Cheers for the reply. Yeah, it isn't the ideal solution in that it foes not guarantee exclusive access to all files for upgrade_export, I am banking on the Mgmnt Console being free most if not every night around that time. I don't suppose you know if there is any log output with the script may produce?
Reply With Quote
  #8 (permalink)  
Old 2007-11-13
Thorpuse Thorpuse is offline
Senior Member
 
Join Date: 2007-07-16
Posts: 447
Rep Power: 2
Thorpuse has an average reputation (10+)
Default Re: Automating upgrade_export

... and you've just identified the other issue with a scripted run of upgrade_export....
Reply With Quote
  #9 (permalink)  
Old 2007-11-20
trinity trinity is offline
Member
 
Join Date: 2007-06-23
Posts: 60
Rep Power: 2
trinity has an average reputation (10+)
Default Re: Automating upgrade_export

Sorry if this is a stupid question but is it safe to map a network drive on the SmartCenter server to allow backups to be made (which would also include the nessarary changes to the security policy)?

Thanks
Reply With Quote
  #10 (permalink)  
Old 2007-11-20
slands10 slands10 is offline
Junior Member
 
Join Date: 2007-10-11
Posts: 8
Rep Power: 0
slands10 has an average reputation (10+)
Default Re: Automating upgrade_export

Hi,
Perhaps someone else can provide some info on this? I hadn't considered it a security problem as it is backed up to a secured NAS, any further thoughts would be much appreciated, thanks :)
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 08:57.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0