2
votes
1answer
523 views

What is wrong with this code?

I have a script that goes like this: while : do Start_Time=$(date +"%s") MAIN PROGRAM GOES HERE (CROPPED TO SHORTEN THINGS) Run_Time=$(( $(date +"%s") - $Start_Time )) if [[ ...
2
votes
3answers
3k views

How to delete the oldest directory in a given directory? [duplicate]

Possible Duplicate: Shell script for moving oldest files? I have a backup directory that stores x other directories that require backuping. I need something that will run before another ...
6
votes
1answer
2k views

How do I get the difference between two timestamps?

I am creating a simple backup script. I would like to have a message saying "You last backed up x days ago" on login. I can create a file when I do the backup "backup/.last_backup_timestamp" but what ...