From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fa528,fbafb8a8f6e25ddc X-Google-Attributes: gidfa528,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!nntp.abs.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeeder.wxs.nl!divide.nova.planet.nl!posting.nova.planet.nl!not-for-mail Date: Fri, 1 Jul 2005 12:01:47 +0200 From: "J. Lievisse Adriaanse" Newsgroups: comp.unix.tru64 Subject: Re: help with a little script Message-ID: <20050701120147.1f54b45b.jasper@nedlinux.nl> References: <1120135568.651614.35110@g49g2000cwa.googlegroups.com> <20050630145309.48b94912.jasper@nedlinux.nl> <1120137537.383023.111450@f14g2000cwb.googlegroups.com> Organization: NedLinux X-Newsreader: Sylpheed version 0.9.0claws (GTK+ 1.2.10; i386-unknown-openbsd3.7) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 80.60.145.215 X-Trace: 1120212229 text.nova.planet.nl 29495 80.60.145.215:46356 X-Complaints-To: abuse@planet.nl Xref: g2news1.google.com comp.unix.tru64:781 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" wrote: > i need to use a sh script >