To schedule a command or script to run at some particular time, the at command is perfect and provides many options for specifying the time you want it to run. It will set the task up to be run whenever you specify, and you can view the scheduled tasks or even change your mind and cancel one of them as you see fit. The at command differs from cron in that it sets up a command or script to run only once, while cron allows you to set up commands or scripts to be run on a specified schedule – whether every day, once a week, a couple times a month or even just once a year. at command syntax Using the at command is relatively easy, though it has a lot of options, particularly on how you specify the time a task should be run. If you specify a time like shown below, the task will be set up to be run the next time you reach 15:27 (3:27 PM), whether that’s today or tomorrow. $ at 15:27 warning: commands will be executed using /bin/sh at Wed Mar 15 15:27:00 2023 at> echo "It works!" > /tmp/test at> job 5 at Wed Mar 15 15:27:00 2023 End the at command by pressing ^D. In the next example, the command is set to run the following date at the time specified. $ at 12:34 tomorrow warning: commands will be executed using /bin/sh at Wed Mar 15 12:34:00 2023 at> echo 1234 >> /tmp/wow at> job 6 at Wed Mar 15 12:34:00 2023 You can specify the time of day in either of two formats. If you ask to have a command run at 11:11, it will be run at 11:11 AM. To specify it to run at 11:11 PM, use 23:11 or 11:11pm as the time. Dates can be also specified in any of these formats: MMDD[CC]YY MM/DD/[CC]YY DD.MM.[CC]YY [CC]YY-MM-DD You can also specify a task on some particular date by specifying a weekday (e.g., Sunday). $ at noon Wednesday warning: commands will be executed using /bin/sh at Wed Mar 15 12:00:00 2023 at> date >> /tmp/test at> job 7 at Wed Mar 15 12:00:00 2023 Listing at jobs To list the tasks scheduled with the at command, use the atq (at queue) command. $ atq 5 Wed Mar 15 15:27:00 2023 a shs 6 Wed Mar 15 12:34:00 2023 a shs 7 Wed Mar 15 12:00:00 2023 a shs The command shows the jobs waiting to be run, but not the tasks they will be running. The details only include the job numbers, the times they will run and the user who added them. Only root is able to view all of the scheduled tasks. Other users will see only their own. Deleting at jobs You can cancel a scheduled job with the atrm command. $ atrm 5 $ atq 6 Wed Mar 15 12:34:00 2023 a shs 7 Wed Mar 15 12:00:00 2023 a shs The command below provides a list of commands associated with the at command. $ sudo dnf repoquery -l at | grep bin [sudo] password for shs: Last metadata expiration check: 1:16:38 ago on Fri 10 Mar 2023 01:40:19 PM EST. /usr/bin/at /usr/bin/atq /usr/bin/atrm /usr/bin/batch /usr/sbin/atd /usr/sbin/atrun /usr/bin/a Wrap-up Regularly scheduled tasks should be set up using the cron command, but to run some particular task at some particular time (no repeats), the at command is flexible and easy.. Related content how-to How to find files on Linux There are many options you can use to find files on Linux, including searching by file name (or partial name), age, owner, group, size, type and inode number. By Sandra Henry Stocker Jun 24, 2024 8 mins Linux opinion Linux in your car: Red Hat’s milestone collaboration with exida With contributions from Red Hat and critical collaborators, the safety and security of automotive vehicles has reached a new level of reliability. By Sandra Henry Stocker Jun 17, 2024 5 mins Linux how-to How to print from the Linux command line: double-sided, landscape and more There's a lot more to printing from the Linux command line than the lp command. Check out some of the many available options. By Sandra Henry Stocker Jun 11, 2024 6 mins Linux how-to Converting between uppercase and lowercase on the Linux command line Converting text between uppercase and lowercase can be very tedious, especially when you want to avoid inadvertent misspellings. Fortunately, Linux provides a handful of commands that can make the job very easy. By Sandra Henry Stocker Jun 07, 2024 5 mins Linux PODCASTS VIDEOS RESOURCES EVENTS NEWSLETTERS Newsletter Promo Module Test Description for newsletter promo module. Please enter a valid email address Subscribe