I'm using ssh to connect to a remote server. And I execute

at 03:13Jun12 -f t.sh

would the remote host run this 't.sh' at 03:13 Jun 12 even if I broke this ssh connection? ( Assume the remote host is keep on running.)


Yes it would. The at command places the script in a file in /var/spool/cron/atjobs, which regularly get checked by the atd daemon.

  • If this command need superuser authority. Will it have effect if I add a sudo at the beginning of at command? – Zen Jun 11 '14 at 14:33
  • The at command has a setuid bit set so when you run it as a normal user it runs as user daemon (on Debian): -rwsr-sr-x 1 daemon daemon 46556 jun 9 2012 /usr/bin/at . The /var/spool/cron/atjobs directory is also owned by user daemon. – mtak Jun 11 '14 at 14:38
  • So this means whatever I use normal user or root user to run an 'at' command, the system will execute it at the specific time? – Zen Jun 11 '14 at 14:48
  • Yes, but it will run it as the user who created the at job. – mtak Jun 11 '14 at 14:50
  • I saw it. I run it as root. By the way, it will be execute at the exact file path where I run the 'at' command? – Zen Jun 11 '14 at 15:34

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.