at command is not executed

后端 未结 5 935
攒了一身酷
攒了一身酷 2021-01-18 04:45

I am trying to make the at bash command to run, but it is not working for me. I can add a job to the queue, but it is not run when the time is up. What am I doi

相关标签:
5条回答
  • 2021-01-18 05:02

    It is working fine. It's just that commands running with at don't write their output to the terminal that you called it from.

    Try:

    at now +2 minutes
    echo TTTEEEST > new_file_test
    

    You'll see the file appear in two minutes.

    0 讨论(0)
  • 2021-01-18 05:02

    I've found this here

    First make sure that the at daemon is running using a command like this:

    # ps -ef | grep atd
    root 8231 1 0 18:10 ? 00:00:00 /usr/sbin/atd
    

    If you don’t see atd running start it with this command:

    # /etc/init.d/atd start
    
    0 讨论(0)
  • 2021-01-18 05:07

    Check your mail:

       An at - or batch - command invoked from a su(1) shell will
       retain the current userid.  The user will be mailed standard
       error and standard output from his commands, if any.  Mail
       will be sent using the command /usr/sbin/sendmail.  If at is
       executed from a su(1) shell, the owner of the login shell
       will receive the mail.
    
    0 讨论(0)
  • 2021-01-18 05:20

    Take a look at /var/at/jobs and see if your at jobs are listed there. (It may be a different directory based upon OS).

    By default, at isn't enabled on most systems. In order for at jobs to actually get executed, the atrun command must execute.

    This command is executed either through launchd or through the cron depending upon the system.

    The exact mechanisms are different from system to system, so you'll have to read all the various manpages on at, atrun, etc. to verify if at is really enabled on your system, and whether you have permissions to run at jobs. There's normally both an ant allow and an ant deny file on your system, so you need to check both. You must be both in the allowed file, and also not in the deny file.

    On top of that, you have to make sure that at is even enabled on your system (due to security concerns, it is usually disabled).

    0 讨论(0)
  • 2021-01-18 05:23

    To analyze at(d) execution problems it may help to

    1. Check /etc/at.allow and /etc/at.deny for existance and contents (see man at.allow)
    2. Check owner and access rights of the atd spool directory (/var/spool/cron/atjobs, daemon:daemon, 770 on Ubuntu)
    3. Check if atd daemon is running (systemctrl -a | grep atd on Ubuntu)
    4. tail -f /var/log/syslog (at execution time)
    5. journalctl -b | grep atd (found that here, contains further hints)

    The "Permission denied" error may also be caused by limited number of logins defined (for the at running user) in /etc/security/limits.conf.

    0 讨论(0)
提交回复
热议问题