echo "echo aaa" | at now +1 minutes
echo "echo aaa" | at now +1 minutes
echo "xmessage -nearmouse -timeout 20 'asdfasd fdasdf'" | at now +1 minutes
You can also give times like now + count time-units, where the time-units can be minutes, hours, days, or weeks and you can tell at to run the job today by suffixing the time with today and to run the job tomorrow by suffixing the time with tomorrow.
*Tags*: cmd:batch
Newsgroups: gmane.linux.debian.user Date: Wed, 16 Aug 2006 12:19:50 +0200
Hi
The traditional Unix batch command is old and not sexy enough to generate enough talk among the Linux users. However, I recently read a post that hinted the powerfulness of the old utility. To make the long story short, here are my questions, which are not explained clearly in 'man batch':
I know that if I list my tasks one by one and sent to the batch command at once, they'd be executed one by one. But what if I issue 10 different batch commands one by one, which are all scheduled "now", would they still be executed one by one? why?
Which parameter is controlling the sequential execution? What if I want to execute batch commands two at a time?
Would batch jobs compete with CPU resources with my foreground tasks?
Do I need to "nice" the tasks before submitting to batch? If not, what is the default nice value for batch jobs?
> if I issue 10 different batch commands one by one, which are all > scheduled "now", would they still be executed one by one? why?
Because batch only runs one command at a time. Try it:
$ batch now > sleep 60 > ^D $ batch now > sleep 61 > ^D $ batch now > sleep 62 > ^D
Now watch ps auxw
> Would batch jobs compete with CPU resources with my foreground tasks?
Of course. But they only start if the load average is <0.8 Look at nqs otherwise.
> Do I need to "nice" the tasks before submitting to batch? > If not, what is the default nice value for batch jobs?
You don't have to, or need to, but if you think it would make the system run more smoothly, then do.
Mine run with a niceness of 4, and I haven't changed anything. Try it.
documented on: 2006.09.11
The nohup utility invokes the named command with the arguments supplied. When the command is invoked, nohup arranges for the SIGHUP signal to be ignored by the process.
The nohup utility does not arrange to make processes immune to a SIGTERM (terminate) signal, so unless they arrange to be immune to SIGTERM or the shell makes them immune to SIGTERM, they will receive it.
Add an ampersand and the contents of file are run in the background with interrupts also ignored (see sh(1)):
example$ nohup file &
nohup pnglog yahoo.com & nohup pnglog bx2blm-atm1-0.montreal.canet.ca 120 &
documented on: 02-27-99
Newsgroups: comp.unix.shell
> how can I control whether to put the group of >commands in background by a variable. I.e, I wish I could do sth like >this: > > { cmd1; cmd2; ... ; cmdn ; } ${background_execution-'&'}
Well, it's not precisely what you're asking for, but how about the functionally similar:
{ cmd1; cmd2; ... ; cmdn ; } & case ${background_execution+set} in "") wait ;; esac
?
Or, if there is some subtlety which somehow makes that inappropriate, how about:
eval '{ cmd1; cmd2; ... ; cmdn ; } '${background_execution-&}
?
Ken Pizzini
>Anyway, >&2 seems to be working is sh. > >Because we say > >echo xxx > somewhere > >and we don't explitly say > >echo xxx 1> somewhere
You're correct. 1> and > are equivalent, whether they're followed by a filename or &<digit>, as are 0< and <. Michael saw the >& and didn't notice that it was part of sh's >&<digit> syntax, and jumped the gun on his criticism.
Barry Margolin
documented on: 07-14-99