|
Posted by Moe Trin on May 5, 2008, 4:03 pm
If you were Registered and logged in, you could reply and use other advanced thread options
On Mon, 5 May 2008, in the Usenet newsgroup comp.security.firewalls, in article
Pussala@gmail.com wrote:
NOTE: Posting from groups.google.com (or some web-forums) dramatically
reduces the chance of your post being seen. Find a real news server.
>I edit script for backup:
>
>#!/bin/sh
>. /etc/profile.d/CP.sh
>cd /var/CPbackup/backups
>echo | backup -d --file /var/CPbackup/backups/
>scp fw_export pluto@172.29.198.23:/data/backup
>exit 0
>
>Can I exec the backup command without me being asked "Are you sure you
>want to proceed?"
You would have to check the manual page for the 'backup' command (which
is not a Linux or UNIX standard command) to see if it has an appropriate
option - I can't imagine why it needs to ask you to proceed. Could this
be a variable that is set in the /etc/profile.d/CP.sh file?
>The command "echo |" not work !!!
At least two problems. First, the 'backup' command has to display the
stupid question, but where does it do this? 'cron' has no standard
terminal, so it _may_ be trying to send the question via email to the
person running this crontab. A solution to that is to redirect stdout
to a file or device, such as /dev/null.
Second problem - the 'echo |' command is going to echo a carriage
return
[compton ~]$ echo | hexdump
0000000 000a
0000001
[compton ~]$
into the pipe, but is the backup program expecting input when invoked?
In your original post you indicated that things worked from the command
line, but not from cron. Does the 'echo |' work at the command line?
If it does, you might try
echo | backup -d --file /var/CPbackup/backups/ &>/tmp/somefile
to see if it's the lack of output device for cron that is causing the
problem.
Old guy
|