[LUNI] scripting challenge - moving logs

Simon L. Epsteyn seva at sevatech.com
Mon Nov 12 20:46:00 CST 2001


You can use 'date', for example:

	# date
	Mon Nov 12 20:44:46 CST 2001

	# date -d yesterday
	Sun Nov 11 20:44:51 CST 2001

	# date "+%b_%d"
	Nov_12

	# date -d yesterday "+%b_%d"
	Nov_11


/Simon

On Mon, 12 Nov 2001, Lance Spitzner wrote:

> Okay,
> 
> I have a challenge, need to move logs from the day before,
> how do I do that?  I have a logging mechanism that creates
> a new subdirectory and new log files each day, so you get
> 
> mozart #ls
> Nov_08  Nov_09  Nov_10  Nov_11  Nov_12  Nov_13
> 
> I want to create a cron job that takes the logs from the
> previous day and moves them to a different system.  So if
> today is the 13th, it grabs the files from Nov_12 and moves
> them.  How does one do this, determining the 'day before'
> challenge?
> 
> Words of wisdom appreciated :)
> 
> 
> 

-- 
seva at sevatech.com
http://sevatech.com




More information about the luni mailing list