in reply to Seeking help on a backup script

The date/time stamp on the archive file may be enough, as holi remarked. I find it useful to store the date, preferrably as part of the file name (as nmdokk suggested) since copying can destroy the original date. Personally I always use the number of seconds since epoc, rather than a "display" date format. It is then much easier to compare with other dates in the same format.
This is the same format used by most file systems, and is returned by stat. You can also get a similar number from time, but don't mix them.

Replies are listed 'Best First'.
Re^2: Seeking help on a backup script
by satchm0h (Beadle) on Aug 30, 2006 at 19:16 UTC
    Given that you are going from a windows box I'm not sure if you ahve access to epoch time. You can always use the localtime values to build up A YYYYMMDDHHMMSS type of date string as well.

    And I third holli's suggestion of encoding the date into the filename and simply sorting based on the filename.

    If you want to go the extra mile you could leverage something like rsync to do incrementals .


    ...stumbling down the path toward enlightenment
      Dear monks,

      Thank you for your ideas/suggestions. I am going to encode the date into the backup filename. It will be easy to determine the older files by sorting on the filenames. Additionally, the filenames will automatically include information on when the backup was made. So, the site admin can use a simple directory listing to check on the backup status.

      Kind Regards,

      Anand Mathur