Hi,
I'm trying the backup a few information commands of my Check Point FW (it's on a SPLAT linux machine). This is the script I wrote:
#!/bin/bash
cd /var/tmp/
file1=netstat_`/bin/date +%d%m%y`.txt
file2=ifconfig_`/bin/date +%d%m%y`.txt
file3=cpstatos_`/bin/date +%d%m%y`.txt
file4=cphaprob_`/bin/date +%d%m%y`.txt
filetar=/var/backup_scripts/`hostname`_netstat_`/bin/date +%d%m%y`.tgz
netstat -rn > $file1
ifconfig -a > $file2
cpstat os > $file3
cphaprob -a if > $file4
tar -zcvf $filetar *.txt
scp $filetar sph1@1.1.1.1:/var/backup/modules/sph1 && rm {*.txt,$filetar} && echo "ok"
If I ran the script Manually it works ok. If I ran it via crontab:
34 6 * * * /var/backup_scripts/backup.sh
three files ($file1 , $file2 and $file3) are generated with no data in them at all (0 bytes). Again , if I manually start the script all the files are created with all the data in them.
Can someone tell me ehat could be wrong with the script ?
10x in advance,
Nirsh