I'm writing a backup script of sorts. My backup server contains 3 directories (named by date in the MM-DD-YYYY format) For example:
- 12-22-2015
- 12-28-2015
- 12-29-2015
Im writing my backup script now to find the oldest directory (12-22-2015) and will name it to todays date (in preparation for an rsync).
My question is, is it possible to find the oldest directory (can be done by either the oldest directory name which is MM-DD-YYYY -OR- by the unix timestamp for that directory -- would prefer unix timestamp as this should be more accurate?)
The catch is I need to store the directory name of the oldest directory as a variable in my local script
Im performing all calls to my remote server via ssh "command" type calls
Thank you!
YYYY-MM-DD
, sort, convert back toMM-DD-YYYY
?