I'm relatively new to Linux and I'm working on a CronTab for scheduled backups.
I figured out how to do multiple sequential jobs with
&&, but I'm unsure how the dependency affects the sequence.
My cron job looks like this:
# Every day at 0:00 (reboot server and do the hourly backup procedure). 0 0 * * * sh shutdown.sh && sh backup.sh ; sh nas.sh ; sh ftp.sh ; sh startup.sh
What I want to happen is to run shutdown.sh and continue the sequence if it's successful, but cancel it if it fails. My fear is it will only skip
sh backup.sh but then continue the sequence.
Will it work as intended? If not, would something like
shutdown && (backup ; nas ; ftp ; startup) be possible?