03-13-06 10:54 PM
alan@ugtv.org writes:
> I'm trying to create an image versioning system.
> Currently the way the system works is:
> There is a live server and a backup server.
> Every day every file on the live server is checked to see what is the
> file's modification date.
> The modification date is compared against the folder structure to see
> if the file exists and if it is newer. If the live server file is
> newer it's copied to the bacup server.
> For Instance
> Live Server
> Image001.jpg Modified 03-11-2006
> Backup Server
> Folder Image001
> -->Folder March
> -->Folder Day01
> -->Image001.jpg Modified 03-01-2006
> -->Folder Day05
> -->Image001.jpg Modified 03-05-2006
> -->Folder Day11
> -->Image001.jpg Modified 03-11-2006
> The problem is:
> I need to be able to read the modification date from the file using a
> UNIX shell script. (It doesn't matter which shell.) I've tried using
> ls and AWK, but I can't find a way to express the ls timestamp in
> YYYYMMDD terms.
> If anyone else can think of a way around this, or a way to do this, I'm
> all ears. Sorry for the long explanation.
Why not just use rsync? (Maybe there's something I'm missing)
Otherwise, gnu ls does have a -time-style option: ls -l --time-style=+%y%m%
d
--
© 2006 Kurt Swanson AB
[ Post a follow-up to this message ]
|