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

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s