Here is an example of a simple backup script I use to backup some files
and copy them to another machine to be put on tape.
echo $HOSTNAME > /var/log/backup.log
echo "Backup Started: " >> /var/log/backup.log
date >> /var/log/backup.log
tar --create --verbose --bzip2 --file /root/tuxtracker.tar.bz
1. the first value passed from the command line would be referenced as
$1 the second as $2
2. run command as part of an if statement. if the command execute
successfully the error result will be 0 and follow the then branch other
wise the else.
On Thu, 2002-10-10 at 15:34, Paul Kraus wrote:
>
At 04:34 PM 10/10/02 -0400, Paul Kraus wrote:
>[...]
>A couple of easy questions I can't seem to find answers to.
Assuming we are talking about standard shell scripts (in practice, ones
that run using bash) ...
>1. How can I pass in parameters from the command line to use as
>variables.
>
I have a script that mounts an samba shared drive, copies the contents
if newer to the Linux box, and then umounts the share.
Sample script
---
mount -t smbfs -o username=x,password=y //machine/share /mnt/network
cp --recursive --preserve --verbose --parents --update /mnt/network/*
/backup/machin
Everyone,
Thanks for your help. Tee is exactly what I needed, and works perfectly.
P.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FA
At 12:15 17/09/2002 +0100, Paul Furness wrote:
>Hi, everyone.
>
>I'm trying to write a bash script which is basically a wrapper around a
>number of other commands.
>
>What I _want_ to do is basically _copy_ stdout and stderr to a log file.
>
>Thus, when I run a command, I wans the stdout and stder
On 17 Sep 2002, Paul Furness wrote:
> What I _want_ to do is basically _copy_ stdout and stderr to a log file.
>
> Thus, when I run a command, I wans the stdout and stderr to go to
> wherever called the script (eg an interactive terminal) but I _also_
> want it to go to a log file.
>
> I can do
Hi, everyone.
I'm trying to write a bash script which is basically a wrapper around a
number of other commands.
What I _want_ to do is basically _copy_ stdout and stderr to a log file.
Thus, when I run a command, I wans the stdout and stderr to go to
wherever called the script (eg an interactiv