You are not logged in.

#1 2017-08-07 09:12:33

Nehfi
Member
Registered: 2016-04-29
Posts: 3

Getting the "at" command to actually run

Hi,

I seem to have an issue with running the "at" command. I've been through the previous thread about at: https://bbs.archlinux.org/viewtopic.php?id=129216, however this doesn't help me solve my issue.

My daemon for atd is running; (from ps -elf | grep atd) -> "5 S daemon    1002     1  0  80   0 -  4207 -      09:50 ?        00:00:00 atd"

I'm just trying to get a testing script to work for now, what I do is:

$ at 11:00 < /full/path/to/justfortestingpurposes.sh
>warning: commands will be executed using /bin/sh
>job 16 at Mon Aug  7 11:00:00 2017

the script should simply make a file, and post a line:  "echo 'This is a test' > foo.txt"

and before the given time, the script seem to be found just fine;

$ atq
>16    Mon Aug  7 11:00:00 2017 a kim

but when the time come around, nothing happens. I'm not even shure which log files to look into for directions.

Offline

#2 2017-08-07 09:45:42

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Getting the "at" command to actually run

`man at` wrote:

       −m    Send mail to the invoking user after the at-job has run, announcing its completion. Standard output and standard error produced  by  the  at-job  shall  be
                 mailed to the user as well, unless redirected elsewhere. Mail shall be sent even if the job produces no output.

                 If  −m  is  not used, the job's standard output and standard error shall be provided to the user by means of mail, unless they are redirected elsewhere; if
                 there is no such output to provide, the implementation need not notify the user of the job's completion.

and

`man at` wrote:

        2. This sequence, which demonstrates redirecting standard error to a pipe, is useful in a command procedure (the sequence of output  redirection  specifications  is
           significant):
               at now + 1 hour <<!
               diff file1 file2 2>&1 >outfile | mailx mygroup
               !

Using this information I think you should be able to get what you want.

Last edited by Omar007 (2017-08-07 09:46:04)

Offline

#3 2017-08-07 10:10:22

Nehfi
Member
Registered: 2016-04-29
Posts: 3

Re: Getting the "at" command to actually run

Omar007, could you expand on that?

I read the man page, however I'm not sure how either would help me.

Offline

#4 2017-08-07 11:38:12

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Getting the "at" command to actually run

Either read the `at ...` output through mail or wrap the command and redirect the output to a file.

That said, the man page also specifies that the working directory should be the directory from which you called at, so if it did execute, I would expect the file to be created there.

Last edited by Omar007 (2017-08-07 11:44:35)

Offline

#5 2017-08-07 14:46:44

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,171

Re: Getting the "at" command to actually run

What do you expect to "happen"?
run "atq", then with the leading number (the job id), "at -c <number>" and post the output.

(WARNING: this contains your environment. If you fell like you need to censor something, do so *transparently* ie. make clear that you redacted the value. Do not just delete things or silently replace them with random strings)

Offline

#6 2017-08-07 16:47:58

Nehfi
Member
Registered: 2016-04-29
Posts: 3

Re: Getting the "at" command to actually run

The problem seems to have resolved itself..?

On another unrelated matter I restarted the computer, and on startup I was able to get "at" to run the script as expected. The weird things is, that I had already tried to restart while trying trying to solve the "at" problem, so I don't know why the second one mattered.

Anyway, thanks for trying to help.

Offline

#7 2017-08-07 20:36:13

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Getting the "at" command to actually run

Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB