BASH Fun: Running a command at a specific time using 'at'. 
[acool@acool2 ~]$ sudo yum install at
...
[acool@acool2 ~]$ sudo systemctl start atd
[acool@acool2 ~]$ sudo systemctl enable atd


[acool@acool2 ~]$ date
Mon Apr 15 16:09:15 PDT 2019
[acool@acool2 ~]$
[acool@acool2 ~]$ echo 'date >> at-fun.txt' | at now + 1 minute
job 79 at Mon Apr 15 16:10:00 2019
[acool@acool2 ~]$
[acool@acool2 ~]$ atq
79 Mon Apr 15 16:10:00 2019 a acool
[acool@acool2 ~]$
[acool@acool2 ~]$ cat at-fun.txt
Mon Apr 15 16:10:00 PDT 2019


[acool@acool2 ~]$
[acool@acool2 ~]$ cat at-fun.txt
[acool@acool2 ~]$ echo 'php -v >> at-fun.txt' | at 4:16 PM April 15 2019
job 84 at Mon Apr 15 16:16:00 2019
[acool@acool2 ~]$
[acool@acool2 ~]$ date
Mon Apr 15 16:15:21 PDT 2019
[acool@acool2 ~]$ atq
84 Mon Apr 15 16:16:00 2019 a acool
[acool@acool2 ~]$
[acool@acool2 ~]$ cat at-fun.txt
PHP 7.0.27 (cli) (built: Apr 4 2018 13:48:44) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
[acool@acool2 ~]$

https://stackoverflow.com/questions/55524769

Comments
Comments are not available for this entry.
2025 By Angel Cool