# Exercise: Back Up While You Sleep

Exercise: Back Up While You Sleep: Exercise: Back Up While You Sleep.

Updated: November 10, 2026

1. [Exercise: Back Up While You Sleep](https://www.ask-codey.com/lessons/exercise-bash-back-up-while-you-sleep) (Journeyman): Finish a nightly backup that cron can run while nobody is there: rsync mirrors a school-work folder, the script works from any folder with a PATH of its own, logs everything with the date and time, takes a lock with flock, refuses to mirror an empty folder and can rehearse with --dry-run; then write its crontab line for 18:00, while a check runs it the way cron would.

Source: https://www.ask-codey.com/courses/bash-in-depth/topics/exercise-bash-back-up-while-you-sleep
