Diffrence b/w at and cron

cron command is used to schedule the task daily at the same time repeatedly.
“at” command is used to schedule the task only once i.e to run only one time.

cron can be edited
at cannot be edited, after its schedule.

mohammedrafi@NOC-RAFI:~$ at 21:22
warning: commands will be executed using /bin/sh
at> echo “this is an at job” > atfile
at>
job 1 at Wed Jul 5 21:22:00 2017

mohammedrafi@NOC-RAFI:~$ cat atfile
cat: atfile: No such file or directory

mohammedrafi@NOC-RAFI:~$ date +%T
21:21:09

mohammedrafi@NOC-RAFI:~$ atq
2 Wed Jul 5 21:25:00 2017 a mohammedrafi

mohammedrafi@NOC-RAFI:~$ cat atfile
this is an at job

mohammedrafi@NOC-RAFI:~$ date +%T
21:22:04

###############################
mohammedrafi@NOC-RAFI:~$ at 21:25
warning: commands will be executed using /bin/sh
at> echo “this is an at job” > atfile
at>
job 2 at Wed Jul 5 21:25:00 2017

mohammedrafi@NOC-RAFI:~$ atq
2 Wed Jul 5 21:25:00 2017 a mohammedrafi

mohammedrafi@NOC-RAFI:~$ atrm 2

mohammedrafi@NOC-RAFI:~$ atq

mohammedrafi@NOC-RAFI:~$ date +%T
21:24:18

 

Leave a comment