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

91 questions
2
votes
1 answer

Using linux' at command - scheduling daily / weekly possible?

I recently came across the at command on the command line, but I am wondering whether I can write a bash script that somehow enables me to tell the at command to run at 8 pm every day, or every monday, every week etc. basically at regular intervals.…
George Welder
  • 2,950
  • 7
  • 31
  • 62
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
4 answers

How to use at command to set python script execute at specified time

When I try to use cron to execute my python script in a future time, I found there is a command at, AFAIK, the cron is for periodically execute, but what my scenario is only execute for once in specified time. and my question is how to add python…
mlzboy
  • 13,296
  • 23
  • 70
  • 94
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
  • 8,891
  • 4
  • 40
  • 70
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
  • 165
  • 8
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
  • 45
  • 1
  • 7
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,728
  • 5
  • 42
  • 72
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
  • 67
  • 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,471
  • 2
  • 20
  • 29
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
  • 13,318
  • 5
  • 30
  • 52
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
  • 23
  • 3
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,217
  • 11
  • 38
  • 59
1
vote
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
1
vote
3 answers

Using Linux 'at' to schedule jobs via C++

I have a C++ program that needs to schedule various future processes to kick off on a one-time-only basis. The development is in Linux so the obvious choice is to use the 'at' command; I'm not interested in writing my own job scheduler! However I'm…
Phil
  • 11
  • 2
1
vote
1 answer

PHP(Apache) doesn't execute BASH command (At + Wget)

So, guys, I have the following code: The main idea is to wget some url at the specific…