Bigbruin.com
Home :: Reviews & Articles ::
Forum :: Info :: :: Facebook :: Youtube :: RSS Feed
Search  :: Register :: Log in
View Single Post  Topic: Linux Help... Cron Jobs 
Author Message
misty
Rated XXX


PostPosted: Wed, 08 Dec 2004 15:23:41    Post Subject: Reply with quote

Okay.. ignore me if you want to, but here's how you could make an archive.

#!/bin/ksh (where ever ksh is located)

FILENAME=dir.tar.`date +%m%d%Y`.tgz

tar -cvzf $FILENAME dir/

To write to another drive:

tar -cvzf $FILENAME /disk2/archive/$FILENAME



To cleanup your backups older than seven days you could run this script daily via cron.

find /dir/path -name "dir.tar*" -mtime +7 -exec rm {} ;

Something like that.. I think that will work, I just came up with it so it's never been tested.
_________________
Meg: Everybody! Guess what I am?
Stewie: Hm, the end result of a drunken back-seat grope-fest and a broken prophylactic?

Stewie: I was under the impression the name of the show was "Kids Say the Darndest Things," not "Old Black Comedians Never Shut the Hell Up."
View user's profile Send private message Visit poster's website

Contact Us :: On Facebook :: On Youtube :: Newsletter :: RSS Feed :: FAQ :: Links :: Sponsors :: Privacy Policy
Copyright © 2000 - 2023 Bigbruin.com - All rights reserved