Artificial intelligent assistant

Find oldest directory name on a remote server? 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!

`ls -t` sorts files by mtime (youngest first), and `ls -r` reverses the sort order, so both `var=$(ssh $remote "ls -t | tail -n 1")` or `var=$(ssh $remote "ls -tr | head -n 1")` should work.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy c46a1e726f86ad6143b075abec4ec803