[Chester LUG] Help with a bash script
Stuart Burns
stuart.james.burns at gmail.com
Fri May 16 10:04:26 UTC 2008
Hi Michael
That is a good idea. However it needs to be chronologically ordered as the
file numbers are sequential and need to dealt with by the other program in
order. Really good idea though.
Stu
2008/5/16 Michael Crilly <e-mail at mcrilly.co.uk>:
> Have you tried something like `time` to obtain a unique unix time
> stamp? Perhaps: mv file `date +%m%u && time`.001
>
> On 5/15/08, Stuart Burns <stuart.james.burns at gmail.com> wrote:
> > Hi Everyone.
> >
> > I need a little help with a batch file. I have managed a bit of it, but
> i'm
> > a bit lost now.
> >
> > What I need to do is
> >
> >
> > 1. Looks for file RS000001.001 in folder
> > 2. Rename it RSmmdnnn.001 (mm=month, d= day number {Monday=1},
> > nnnn=unique count for the day)
> >
> > Now this file can appear up to several times a day (ie its going to run
> as a
> > cron job every half hour to pick up the files as they are dumped by ftp)
> I
> > can do the basic stuff with the date ie DATE = `date +%m%u` but setting
> up
> > the nnnn bit is where I am getting lost.
> >
> > Any help appreciated.
> >
> > Stu
> >
>
> --
> Sent from Google Mail for mobile | mobile.google.com
>
> M. T. Crilly
> http://www.mcrilly.co.uk/
>
> _______________________________________________
> Chester mailing list
> Chester at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/chester
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/chester/attachments/20080516/300b3d5a/attachment.html>
More information about the Chester
mailing list