~/backup.sh DIR runs every night at 3 AM. Last night someone renamed a shop's folder, and the script:
- split
card reader.confand theeast sidefolder into two words; - kept going after
cdfailed, and deleted the.tmpfiles in the home folder; - left its temp folder behind in
/tmp.
Make it safe. You have 15 minutes. If the time runs out, you can still finish.
basename PATH prints the last part of a path: basename ~/app/conf prints conf.
Objectives
./backup.sh ~/app/confbacks up all three.conffiles, and so does a folder whose name has a space.- A missing folder: exit 1, nothing on stdout, nothing deleted.
- A failed run leaves no temp folder in
/tmp.