Questions tagged [at-job]

"at" is a classic Unix command that read commands from standard input (or a specified file) which are to be executed at a later time, using /bin/sh. Use this tag for questions related to programmatic use of "at"; trouble shooting and general usage questions might be better suited for Super User or Unix & Linux.

at is used to schedule commands for one-time execution, as opposed to jobs, which are run at regular intervals.

Relevant links

Related tags

97 questions
2
votes
2 answers

Schedule some jobs with php/python at some specific time without crontab

I have some irregular jobs to do(frequent and many), so I can't use the crontab. for example: send an email at 10:20AM on July 22 2012 post a article at 11PM tonight run a script at 9:50AM tomorrow. I found the linux commond at, but that can't be…
lostsnow
  • 23
  • 2
2
votes
1 answer

How to send a future email using AT command

I just need to send one email into the future, so I figured i'd be best at using at rather than using cron. This is what I have so far, its messy and ugly and not that great at escaping:

        
ParoX
  • 5,685
  • 23
  • 81
  • 152
2
votes
1 answer

PHP "AT command" not executing on nginx ubuntu 16.04

php sample code Not working on server: exec('echo "hello world" | at now + 2 minutes'); On terminal same code successfully getting executed below code : echo "hello world" | at now + 2 minutes We are using php 7.0, ngnix, ubuntu 16.04 i am…
2
votes
0 answers

Parse atq and get at-job id

So far i managed to get list of running jobs. I use: at -c $(atq | cut -f 1)|grep "at now" I get: at now + 1 minute -f /folder/file1.sh at now + 30 minute -f /folder/file2.sh at now + 3 minute -f /folder/file3.sh >> /folder/temp.log …
no_name
  • 31
  • 1
  • 5
2
votes
1 answer

How to get the result of a command in a HERE_doc in Bash

I'm using the at command to schedule a job in the future. DoCurlAt () { if [ -n "${AuthToken:-}" ] ; then $4 << 'EOF' curl -s -H "${AuthHeader:-}" -H "$1" --data-urlencode "$2" "$3" EOF Exitcode=$? fi WriteLog Output…
willemdh
  • 796
  • 2
  • 13
  • 34
2
votes
2 answers

Test syntax of at command time argument

I would like to test an at time argument before running the at command. The use case is that I would like to run the at command on a different computer at a different time, so I want to first store the at argument, which means I want to check it…
Xu Wang
  • 10,199
  • 6
  • 44
  • 78
2
votes
1 answer

bash is not executed 'at -f foo.sh' command, even with #!/bin/bash shebang

I'm using the 'at' command in order to create 3 directories, just a dumb bash script: #!/bin/bash for i in {1..3} do mkdir dir$i done Everything is ok if I execute that script directly on terminal, but when I use 'at' command as follows: at -f g.sh…
Hellzzar
  • 185
  • 1
  • 9
2
votes
2 answers

Redirecting output of shell script to text file

I am trying to redirect the output of my script(scheduled using at command) to a text file. at -f shelltest.sh -v 11:33 > data.txt Even the script is running successfully, the output is not getting saved to output text file(data.txt). Say my script…
user3089474
  • 65
  • 3
  • 8
2
votes
3 answers

How can I allow PHP to use the at command in exec() calls when SELinux is enabled?

I have a PHP script that takes a long time to load. We have moved our sites to a new server which lives behind a cloud load balancer. The maximum time limit for the load balancer is 120 seconds, but the script takes well over 5 minutes. Splitting…
LeonardChallis
  • 7,759
  • 6
  • 45
  • 76
2
votes
1 answer

Assigning the output of the "at" command in a bash script

I'm trying to capture the results of the "at" command inside a Bash script. The various ways of capturing command output don't seem to work, but I'm not sure if it's the pipe in the command or something else. echo $cmd | at $deployat produces the…
Teg Ryan
  • 77
  • 1
  • 5
2
votes
2 answers

When I exec a script with command "at", I get an infinite loop

I am learning bash shell and I'm a beginner. Now, I have a script named for_test #!/bin/bash var1=3 until [ $var1 -eq 0 ] do echo "Outer loop: $var1" var2=1 while [ $var2 -lt 5 ] do var3=`echo "scale=4; $var1 / $var2" | bc` …
android_su
  • 1,637
  • 4
  • 21
  • 30
2
votes
1 answer

How to get number of job created by the Linux "at" command

I know I can create and remove scheduled jobs using the Linux at and atrm commands. Is there a way to get the number of a job at the time at is executed? atrm needs the job number to remove it. I can think of workarounds like using unique queue…
marekful
  • 14,986
  • 6
  • 37
  • 59
2
votes
1 answer

cron one time higher priority job exception

Is there a way of telling cron that if there is a job with higher priority at the same time it should only execute the higher priority job? For example: 0 12 * * * ~/ring_a_bell.sh # mplayer bell.wav would be standard ringing. But one time only for…
user184950
  • 33
  • 4
1
vote
1 answer

Unix `at` command via PHP

Here's my code to create a new at job... system('echo \'php -f /path/to/my/php/file.php\' | at 1700'); I thought this would be simple and would just work but alas, nothing happens! When I run echo \'php -f /path/to/my/php/file.php\' | at 1700 via…
Sam
  • 4,437
  • 11
  • 40
  • 59
1
vote
1 answer

Problem with notification scheduling in WEB Applications

Context I'm currently implementing a feature to schedule notifications for a specific period through a web form using PHP and Firebase. To send the notification I use Firebase and it sends notifications to Android/Ios. To schedule the notification I…