Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: "J. Lievisse Adriaanse" <jasper@nedlinux.nl>
Subject: Re: help with a little script
Date: Fri, 1 Jul 2005 12:01:47 +0200	[thread overview]
Message-ID: <20050701120147.1f54b45b.jasper@nedlinux.nl> (raw)
In-Reply-To: 1120137537.383023.111450@f14g2000cwb.googlegroups.com

Ok, this one should work. I have tested it on my OpenBSD laptop, but you probaly have to adjust the variables (especially date, since it differs per OS). You have to make sure that the $DESTDIR has been created before running the script.

#!/bin/sh
#
# J. Lievisse Adriaanse, 2005, BSD-license. 
# Purpose: A quick backup script for Mabus.
#

TEMPDIR=/tmp/archives
DESTDIR=/var/backup/tar/
ORIGDIR=/home/mabus/archives/
FNAME='/bin/date +%Y-%m-%d'

mkdir $TEMPDIR

cd $ORIGDIR
for i in `/bin/ls`; do
	mv $i $TEMPDIR
done

cd $TEMPDIR
tar -cf `$FNAME`.tar *
mv `$FNAME`.tar $DESTDIR
rm -fr $TEMPDIR


Cheers,
Jasper



On 30 Jun 2005 06:18:57 -0700
"mabus" <mateo.monsalve@gmail.com> wrote:

> i need to use a sh script
> 




      reply	other threads:[~2005-07-01 10:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-30 12:46 help with a little script mabus
2005-06-30 12:53 ` J. Lievisse Adriaanse
2005-06-30 13:18   ` mabus
2005-07-01 10:01     ` J. Lievisse Adriaanse [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox