Programming :: Using `jobs` In A Script Not Working
Aug 30, 2010why when I use "jobs -l >> tmp" in a script file it does nothing, and when typing it at the prompt it creates the tmp file I expect it to...?
View 9 Replieswhy when I use "jobs -l >> tmp" in a script file it does nothing, and when typing it at the prompt it creates the tmp file I expect it to...?
View 9 RepliesI tried using the jobs command in bash in F14 but nothing happens.
Code:
[root@Fedora ~]# jobs -l
[root@Fedora ~]#
Code:
[root@Fedora ~]# which jobs
[Code].....
If jobspec is given, output is restricted to information about that job. The return status is 0 unless an invalid option is encountered or an invalid jobspec is supplied.
If the -x option is supplied, jobs replaces any jobspec found in command or args with the corresponding process group ID, and executes command passing it args, returning its exit status.
Is the jobs command dropped for the ps command instead ?
I use an application called redbutton-browser to access some of the things available on the redbutton digital tv channels. It compiles fine if I use a simple make but fails if I try to run parallel jobs with make -j4. I'd like some help altering the Makefile so that it does a few commands sequentially before it does the rest of the Makefile in parallel.
The relevant bit of the Makefile looks like this:
Code:
ISO13522-MHEG-5.c:xsd2c.c ISO13522-MHEG-5.xsd add_instance_vars.conf add_rtti.conf
make xsd2c
./xsd2c ISO13522-MHEG-5.xsd
./add_instance_vars ISO13522-MHEG-5.c ISO13522-MHEG-5.h
./add_rtti ISO13522-MHEG-5.c > rtti.h
[Code]....
Have a headless server running Lucid 64 bit. Everything is working great except for a couple of Cron jos I'm trying to have run at boot.
My user crontab looks like this:
# m h dom mon dow command
01 * * * * /home/ceallred/Scripts/SambaBkup.sh
@reboot /usr/bin/SpiderOak --headless &The SambaBkup script works like clockwork...
The SpiderOak job doesn't start. It works if I type the command in manually.
syslog only shows:Jul 13 22:45:33 RavenWing cron[1010]: (CRON) INFO (pidfile fd = 3)
Jul 13 22:45:33 RavenWing cron[1022]: (CRON) STARTUP (fork ok)
Jul 13 22:45:33 RavenWing cron[1022]: (CRON) INFO (Running @reboot jobs)
Jul 13 22:45:33 RavenWing CRON[1048]: (ceallred) CMD (/usr/bin/SpiderOak --headless &)Yet ps -A doesn't show a running SpiderOak process. It shows after starting manually.
I need to spawn 2 processes in parallel and each takes an hour or so to finish. Is the following one of the correct ways of using `at` in a script run by crontab?
Code:
#!/bin/bash
# define the env var, cd, etc... assume everything ok up to this point
date +"The start time is %H:%M:%S"
rm -f a.fin
at now <<END_OF_AT
do_a &> a.log
[Code]....
I'm looking for a general pointer, or label for what I am trying to do. Not a specific line of code. I've written a couple of small sh script that gets some user input, then calls several programs to run in the background with the &. My problem is, they all run at the same time. Is there some way to get these jobs to run sequentially rather than consecutively? If yes, what is this process called? I'm thinking there should be a way to line up background jobs in a job queue, similar to how a print queue works, one job at a time. After searching for a couple of hours, I'm thinking there must be a name for this, but I don't know what it is.
View 11 Replies View RelatedI am trying run audio conversion on my server that I want limited to a certain number of processes based on process name. I am using the following script but it isnt limiting the number of job like I want it to.
Code:
#!/bin/bash
$num_jobs = 13
while [ $(ps -A | grep -v grep | grep -c pacpl) -ge $num_jobs ]
do
sleep 1
[Code]...
I want to write a shell script for submitting multiple jobs sequentially. For example,
#!/bin/bash
qsub job1.sh
# when job1.sh is done, run the next one
qsub job2.sh
how to make the shell script know that job1.sh is done and now I can run job2.sh?
I have this in my crontab (along with another line before it):
Code:
* * * * * /bin/echo "Does this work?" > ~/test
...and the file doesn't show up. I have a blank line after that one in the crontab. I have no /etc/cron.allow or /etc/cron.deny files. I'm running Ubuntu 11.04. /var/log/syslog shows "BEGIN EDIT" and "END EDIT" etc. when I run crontab -e, but doesn't say anything about trying to run commands. Anything I might be missing?
I just reinstalled linux on one of my computers, and now it seems that any scripts in the rc.d folders don't run at boot. I have to go in manually and start them all after I can get to a terminal. I have webmin running on this computer, and no matter what I do, it always says that nothing is supposed to start on boot, even though the scripts are clearly in their respective rc.d folders. What can I do to fix this?
View 1 Replies View Relatedwhy my jobs manpages are missing? I noticed that there is Ubuntu manpage entry. [URL] Also when I check on various Linux systems it takes me to BASH_BUILTINS(1). I also can't seem to find BASH_BUILTINS(1) on my system either.
View 5 Replies View Relatedi need to know how to set cron jobs up for programs like eggdrop and psybnc
View 1 Replies View RelatedI am learning terminal and i want to kill a process. There are 2 ways to do it i ve heard. 1st way is to type following in terminal:
[Code].....
I have a cron job that executes fine in opensuse 11.4. It is located in
/etc/cron.d/publish.cron:
jpablo /srv/django-apps/smcommand/scripts/publish.sh
It is correct, I want it to execute every minute. Now, I copied the same script to ubuntu maverick, and it doesn't run. Perhaps there's some ubuntu peculiarity that I'm not aware of?
I have a Fedora 11 box and I am confused about cron, where exactly do I enter the cron jobs? For example, I have a job that needs to run every half hour.
View 8 Replies View RelatedI put a backgroud job in redhat5 as nohup commad script & I do not see end thsi jon. now I want to bring to as foreground job. how to do this? some paper told me as jobs jobnumber. jobs and spa does not work
ps ua does not return a job number
Cron doesn't run jobs in Debian 64 (testing). It gives error
Code:
Apr 6 15:31:01 debian64 /USR/SBIN/CRON[5454]: (CRON)
Error (grandchild #5455 failed with exit status 1)
and does not run the script.
Since my last server upgrade, last Thursday, cups is having a strange behavior: I have 3 text-only printers, and an application that prints to them. The application, to print 5 lines, it sends 5 jobs to the printer. Before the upgrade, all the jobs where printed sequentially, without any delay. After the upgrade, cups makes a small delay (5s or more) between every one...Its very annoying for the users...
View 1 Replies View RelatedIn my office there is a department where the access of internet & intranet is very limited. I've been given a task that I should add a script which would automatically take screenshots of the PCs. The script works fine, but I can't make it work with the cron jobs. There are many methods given on the internet to grab screen, but none of them works with cron.
View 2 Replies View RelatedI need to review what people are using the printers for at work.I was wondering how I can do this under fedora. I basically need to store a copy of the printed jobs and view them afterwards..
View 5 Replies View RelatedSo I have Fedora 14 installed on a laptop directly connected to my printer. I really never use the laptop except to send print jobs to it wirelessly. I was wondering if there was a way to make it suspend or sleep, or even idle everything down so it uses less power, but still listen for print jobs?
View 2 Replies View RelatedI see so many guides on how to run crontab, but what I need right now is to learn how toFind log files about cron jobsConfigure what gets logged
View 3 Replies View RelatedFor some reason my cron jobs are not running and I can't seem to figure out why.
Here is crontab -l
Code:
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
[code]...
I have 2 printers plugged into a Windows XP PC (an Epson Stylus Photo RX580, and an HP Laserjet 1020) with full sharing on and everything, and is shared with other Windows PCs via the network I have set up. It has worked perfect. But today I added a PC running Ubuntu 9.10 and and can't figure out for the life of me what I am doing wrong. I installed both of the printers via the GUI in Administration, and both of them are detected and Ubuntu says they're working. But when I put something in the queue to print it stays there with the status "pending".
View 8 Replies View RelatedI use crontab for a daily alarm clock, which stopped working after I moved to Lucid.
Code:
$ crontab -l
# m h dom mon dow command
[code]...
I want to add two separate tasks/jobs to Cron that needs to run every 10 minutes, but I would like the second job to kick off only 5 minutes after the first job. Is there any way this could be done within Cron?
View 2 Replies View Relatedrun a cron job to download my email logs to my laptop. But the question is HOW? Im not sure how to write the php script for the cron job. the file is on "computer A" and the file is setup to chmod I just need to know how to write the php to "access" the other computer and then download the file to a certain file on my laptop.
View 3 Replies View RelatedI am running Ubuntu 10.10 on a new Dell PowerEdge.
I built the system ~2 months ago and have successfully been running a list of cronjobs.
The jobs last ran on 5/31/11 at 7:35am. Since then none of the jobs have run.
I see "cron" in the process list when I run ps.
How can I cron jobs for less than a minute for example configuring cron job to do something for each 15 seconds.
View 4 Replies View RelatedI am having a shell script which runs perl jobs.The script is starting the perl jobs when it is executed manually from the command line , but when the same script runs from crontab it is not starting the perl jobs.I have these things in the begining of the script
. /etc/profile
export MDX_HOME=/home/entsms
source $MDX_HOME/.bash_profile
[code]....