Hot answers tagged

13

at -c jobnumber will list a single job. If you want to see all of them, you might create a script like #!/bin/bash MAXJOB=$(atq | head -n1 | awk '{ print $1; }') for each in $(seq 1 $MAXJOB); do echo "JOB $each"; at -c $each; done Probably there's a shorter way to do that, I just popped that out of my head :)


7

My guess would be that whatever shell your at job is using is different to the one that you use at the command line, and the at job shell doesn't have a kill built-in that knows about symbolic signal symbols. This is common on Ubuntu, which uses dash for /bin/sh (which is used by at by default) but /bin/bash for interactive shells. You can use the 'kill' ...


5

Netsend messages have been removed from Windows 7. One way I have found to do this without installing 3rd party software is to leverage the remote shutdown commands: shutdown -m //computername -r -f -c "MESSAGE" -t 120 shutdown -m //computername -a The first command pops a message up, and will begin the shutdown in 120 seconds, the second command will ...


5

Before it starts running, use atrm to remove the job from the queue; afterwards, use kill. By the way, at won't run it every minute, as your question appears to suppose; it will run it once, in 60s time. To run it every minute, use cron.


4

According to the man page of cron in Solaris 10: NAME cron - clock daemon SYNOPSIS /usr/sbin/cron DESCRIPTION cron starts a process that executes commands at specified dates and times. You can specify regularly scheduled commands to cron according to instructions found in crontab files in the directory ...


3

by vbscript: dim WMIObj, strHost, intProcessID on error resume next strHost = "remotehost.domain.com" set WMIObj = GetObject("winmgmts:\\" & strHost & "\root\cimv2:Win32_Process") if IsObject(WMIObj) then WMIObj.Create "cmd.exe /C msg * ""ha-ha-ha""", null, null, intProcessID end if set WMIObj = nothing


3

This command was more useful when the typical *nix machine had very few processors, but was heavily shared between users. As man batch states, batch executes commands when system load levels permit; in other words, when the load average drops below 1.5, or the value specified in the invocation of atd. So it ...


3

Try this: $ echo "curl -k https://localhost/projekt/crons/purge/5 > projekt.log 2>&1" | at now + 5 minutes


3

From looking at the source of the 'at' program (from the CentOS 5.3 source repository) , it looks like it is indeed logging to syslog, but only fatal errors regarding the at daemon itself are logged (for example, if you try to run 2 at daemons at the same time). However, process executions, resulting return code and standard error/output are not logged to ...


3

If you just enter at without any parameters, it will show scheduled tasks. Also, normally you should get a hint "Added a new job with job ID = x".


3

What OS are you using? On Centos Redhat 5. I was able to restart atd with /etc/init.d/atd restart. My running jobs were unaffected and my scheduled jobs survived the restart: $ date Mon Dec 12 16:41:07 GMT 2011 As root: # /etc/init.d/atd restart They are still in the atq: $ atq 2 2011-12-12 16:37 = bobby 1 2011-12-12 16:36 = bobby 4 ...


2

For CentOS and related the environment variable SHELL is read when the at command is issued and this is used as the shell to execute the commands or if it is unset then the user's login shell is used. It looks like Ubuntu ignores this although it does warn you - warning: commands will be executed using /bin/sh. Can you not just write your commands in a file ...


2

Is it possible that atd is not running? ps -ef|grep atd This is a bit of a long shot because you would get a warning from the at command if the daemon were not running.


2

The job probably did not run because of a broken Ubuntu update: Jun 4 11:38:00 server01 atd[32330]: Module is unknown References: http://forum.linode.com/viewtopic.php?p=39867 https://bugs.launchpad.net/ubuntu/+source/pam/+bug/790538


2

I can see that the strings differ in the date/time format. You can split the output into two substrings (job 4 at), and the date/time part. Then, you can parse the date using the function strtotime. At the end, you can combine the first part with the parsed date/time. So, you get a uniform ouput. Also, you can convert the date/time part to the desired ...


2

You can normalize the dates using something like: date -d "$date" --rfc-3339=seconds I was going to suggest the following, but at seems to ignore locale environment variables: LC_TIME=C at -v ... # has no effect


2

I'm getting CMD.EXE and NOTEPAD.EXE to start fine w/ the /INTERACTIVE switch on Windows Server 2003 Standard 32-bit Service Pack 2. I suspect you're connected to a non-console session with Terminal Services. The programs started by Scheduled Tasks from an AT w/ the /INTERACTIVE switch will show up in session 0, which is visible only on the console (or a ...


2

When you invoke the at command it copies the current environment so that's what you're seeing. The working directory, the environment (except for the variables TERM, DISPLAY and _) and the umask are retained from the time of invocation. You are running at in a php script via apache so what you are seeing in the script is the environment etc that ...


2

running $ strace at setreuid32(1000, 1000) = 0 setregid32(1000, 1000) = 0 open("/etc/at.allow", O_RDONLY) = -1 ENOENT (No such file or directory) setregid32(1000, 1000) = 0 setreuid32(1000, 1000) = 0 setreuid32(1000, 1000) = 0 setregid32(1000, 1000) ...


2

The following command works with XP and 7 initiated from 2003 server: at \\remotecomputer time /interactive msg remoteuser /SERVER:remotecomputer This is the message The remotecomputer is the computer where the message should appear and the remoteuser is the user logged into the remote computer (user who should see the message). To clear all at commands ...


2

This should be doable with the msg. Something like msg <username> /SERVER:<servername> <message


2

There may be some distro-specific differences, but the largest difference I've found is that cron scripts do not have any sort of default environment settings, while at scripts do. This may be the result of my never using at to schedule a job for after I've logged out, however, so take it with a grain of salt.


2

From the manual of at : The special queue "=" is reserved for jobs which are currently running. So if the job is in this queue it means that it's currently running. For example [root@test ~]# atq 8 Thu Oct 22 00:32:00 2015 a root 9 Wed Oct 21 23:38:00 2015 a root 10 Wed Oct 21 23:35:00 2015 = root In that case the job number 10 is running. ...


2

The problem appears to be that from my understanding Zenoss sends the actual message to the scripts STDIN input, but your script expects it as a command line parameter. You have to modify your expect script in a way that it will read the message from STDIN instead of $argv 3. After that, your test script should work like this: echo "Message" | ./sms.sh ...


2

It's working, I looked in the /usr/local/zenoss/Products/ZenUtils/Utils.py file to find that Zenoss sends the message text to stdin so I only needed to read stdin in the expect script to get the message. Here is the new working script: (note that I left out host & port parameters) #!/usr/bin/expect # - VAR set ctrlz \032 set xt \135 set timeout 15 set ...


1

You could check the parent process name by using the ${PPID} environment variable and looking for that in ps.


1

You can't use a parameter in the AT command to do this for a single command. You could create a crazy amount of them to suffice (say 24 to have it run every hour every day). My advice is to stop using AT and use the schtasks command that replaces it. http://support.microsoft.com/kb/814596 It will let you create a cmd line task that will do what you are ...


1

Does /etc/at.allow exist? If it does, any users which aren't explicitly listed in it are prevented from running at.


1

/var/log/secure(RHEL) atd logs via PAM, check your syslog.conf to find out where pam is logging to.


1

It turns out that dash likes signals in the form -CONT and doesn't understand the -SIGCONT style. Since bash understands both, it may be more portable to use the former. In my testing, it didn't make any difference whether I included an explicit path to 'kill' but the way the signal is specified did.



Only top voted, non community-wiki answers of a minimum length are eligible