[prog] [Bash] script question

Terri Oda terri at zone12.com
Tue Oct 1 23:41:51 EST 2002


> > The only other thing I see, offhand, is that if you keep moving these files
> > like this, you'll end up with filenames like
> > 	mail-Aug-2002-Sep-2002-Oct-2002
> > after you've run this in consecutive months.
> 
> That wouldn't be a problem I think. What I'm trying to do is the rename
> each file at the end of each month(with the help of cron), tar bzip them up
> and move the bzipped file to another machine. I'm now trying to work out
> how to use ssh-agent so that it'll ship off the tarred file automatically.

It won't if you remove the files once you've done the bzipping and all, but
if you don't (and I didn't see anything to do it in the script), it happens
like this:

Original folder contents:
	amy 
	bob 

August script run makes:
	amy 
	bob 
	amy-Aug-2002
	bob-Aug-2002

September Script makes
	amy
	bob
	amy-Aug-2002
	bob-Aug-2002
	amy-Sept-2002
	bob-Sept-2002
	amy-Aug-2002-Sept-2002
	bob-Aug-2002-Sept-2002

etc.  

Because every new month, it looks at *all* the files in your mail directory,
not just the ones that haven't got a date tagged onto the end of the filename.

 Terri



More information about the Programming mailing list