Scheduling one-time jobs for Linux
We may need some maintenance works for our database systems. If we don't want to spend our evening with all rebooting processes, "at" command is here to help us.
echo "<command>"|at 22:00 Jan 18 2024
This command belows run specific job at desired date. More specific example for maintenance at a postgresql database would be:
echo "yum update -y\nsystemctl stop postgresql-15.service\nreboot" |at 23:00 Jan 20 2024
We can list all jobs with "atq" command. Moreover, with "at -c <id>" we can check what command is scheduled with details. If some schedule entered mistakenly, "at -r <id>" command would help us to remove.
Comments
Post a Comment