[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] copy with dynamic rename
- Subject: [ale] copy with dynamic rename
- From: ale at netherealm.net (Ron Mellema)
- Date: Fri, 22 Sep 2000 16:18:23 -0400 (EDT)
On Fri, 22 Sep 2000, Andreas [iso-8859-1] K??pp wrote:
> Hi!
> I've got to copy and gzip all files of an directory with a cronjob but
> the files got to be renamed in a way that the result looks like this:
> originalname.<date>.gz
I am no expert but I did this with advice of an expert. Below is a sample
of a bash script that runs from cron
#!/bin/sh
PURGE=`date '+%y%m%d'`
cp /var/log/warn /var/log/oldlogs/warn.$PURGE
Ron Mellema
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.