`
If you find these tutorials useful, Please consider making a donation.

TheFrugalComputerLinuxLogo.png
TheFrugalComputerGuy.png
Linux Command Line 16
Job Scheduling







Linux Command Line (53) cron pt1

Backups, commands, and scripts can be run on a schedule using cron.

The command 'crontab -e' will open the selected editor to edit the cron file. The selected editor can be changed at any time.

crons can be set up to run by minute, hour, day of month, month, and day of week.

When a cron job runs on an Ubuntu system, the file /var/log/syslog is updated

The output from a cron can be redirected to directory in a home directory

We schedule a cron job to run a backup once a week





 






Linux Command Line (54) cron pt2

We update output file names for the cron created in the last video to include the date the cron was run in the output files.

We then create a cron to sync two directories ever minute.

We then look at where the crontab files a located and how a privileged user can update another users crontab file by adding -u and the userID of the crontab file to be edited.

We then look at how cron.deny and cron.allow work





 






Linux Command Line (55) anacron

Anacron is useful for scheduling a job to run on a computer that is turned off regularly.

Only privileged users can schedule an anacron job. Anacron jobs are scheduled in time frames of hourly, daily, weekly, or monthly.

If a computer is not powered on at the time a cron job is scheduled, that cron will be missed and will not run.

If a computer is not powered on when an anacron job is scheduled to run, the next time that computer boots up, anacron will check to see if the scheduled anacron jobs need to run.





 






Linux Command Line (56) at

To schedule a job to run a single time in the future, we would us "at". It is called "at" because that job is scheduled to run "at" a specific single time.

At does need to be installed Linux Mint computer used in this video and a few moments spent on how to start, stop and enable a service.

We then look at how to schedule an "at" job, how to see what "at" jobs are scheduled, what commands are in our scheduled "at" jobs, and how to remove an "at" job from the "at" queue.





 






Linux Command Line (57) systemd.timer pt1

The systemd.timer needs 3 things:
A script to run
A systemd.service to run the script
A systemd.timer to run the systemd.service at the time the script should run

In this video we will create the script and systemd.service files and look at how to run the systemd.service

In the next video, we will write the systemd.timer and run it





 






Linux Command Line (58) systemd.timer pt2

In this video, we create and run systemd.timer file to run the systemd.service and script created in the previous video at a specific time.

We then create second script, systemd.service, and systemd.timer file to run a few minutes after the computer boots up.