Simple script addition needed...

aquamanx

Registered
I am trying to create a cron job and I have a shell script that is working awesome on making my backups, but what I want to do is delete it after it copies over or by date of the file. I have it placing a date on the end of each file so I know which one is which...any ideas on how to do this...thanks...I;m new to sheel shell scripting so I am lost...

spencer parker
 
If you want to add a date after the filename, you can do this -

# Defines the backup filename
# Note the quote in the below is the
# key beside the key "1"
BACKUP_FILENAME=backup.`date +%d%m%Y`

# If you use tar as the backup method
tar cvpf $BACKUP_FILENAME things_needed_to_be_backuped/*

I use /bin/sh as the shell. If you want C shell scripts, I'll try to make one for you.
 
What I have is an OS X Server and I found a way to back up usig hfspax...I need to preserve all the metadata for use with OS 9 machines...I have been using a script that pack my netinfo into a tarball then users dir into a folder and then scp them to another Darwin box. I just need to kill the old ones so they don't build...if you have any good backup solutions for OS X server it'd be very appreciated...thanks...

spencer parker
 
Back
Top