Sponsored Content
Top Forums UNIX for Dummies Questions & Answers At, Batch, Nohup, Cronjob... etc. Post 302605167 by someoney3000 on Tuesday 6th of March 2012 07:53:48 PM
Old 03-06-2012
Quote:
Originally Posted by Corona688
It does exactly what you think, runs in background in a way it won't hold open your shell window and won't die if your terminal does. If you're using this to manually run things in a manner that won't be killed, I don't see any problem with it.

For some shells(bash, ksh) you might want to add 'disown' after the & to prevent the shell's own job control from waiting for it or trying to kill it.

If this is part of a script, something which gets run automatically, it may be more appropriate to use a scheduling system like cron or at to control it instead.

Alright thanks.

I'm trying to grasp all the different tools at my disposal, so it's good to have a confirmation that I'm using them correctly.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Help on nohup

Hi I submitted a long running executable without using nohup. Now, is there any way I can assure to keep that process ON even if my session gets killed? Thanks Bobby (3 Replies)
Discussion started by: bobbyjohnz
3 Replies

2. UNIX for Dummies Questions & Answers

nohup - help!

I find that if I use nohup (in bourne shell script) then all the interactive parts in my code are gone hidden... e.g., the places asking input from the user (such as ckyorn) will not be displayed. This is no good. Is there a way to use nohup (or similar utility) and meanwhile, to keep the... (9 Replies)
Discussion started by: bluemoon1
9 Replies

3. AIX

nohup.out

I have a program which writes to nohup.out ... over the time this nohup.out becomes a large file and i cannot read the contents of this file using a vi editor.... whe i do a vi nohup.out it gives an error insufficient memory.... do i need to clean this nohup.out periodically ( or compress it... (5 Replies)
Discussion started by: ramky79
5 Replies

4. UNIX for Dummies Questions & Answers

When we need nohup

Hi, I've read the man page on nohup. But I still can't see what's the differences if we just send a process to background versus sending a nohup process to background. eg: myprocess & vs nohup myprocess & Without nohup, myprocess would still run uninterruptible at background... (2 Replies)
Discussion started by: ehchn1
2 Replies

5. UNIX for Dummies Questions & Answers

how to cancel a cronjob if the cronjob still running

hi everyone I'm newbie in this forum hope I can get some help here :) I have a command in crontab that executed every 1 minute sometime this command need more than 1 minute to finish the problem is, the crontab execute this command although it's not finish processing yet and causing the system... (7 Replies)
Discussion started by: 2j4h
7 Replies

6. UNIX for Dummies Questions & Answers

nohup

Hi, We are trying to run a shell script using nohup command. But this scripts asks for user input (username and password). Once we enter credentials it should continue run in background. Can someone please suggest how can we implement this? we can't modify .sh file since they are provided by... (5 Replies)
Discussion started by: blak
5 Replies

7. Shell Programming and Scripting

Executing a batch of files within a shell script with option to refire the individual files in batch

Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below. I am on a solaris server btw. Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose. ... (2 Replies)
Discussion started by: goddevil
2 Replies

8. UNIX for Dummies Questions & Answers

Nohup

Hi Every one , i wrote a script for nohpu ,which checks the service by using the port number and starts if it doesnt hear the port. It works good untill i colse the session. how to make it work even after closing the session .And aslo how to deamoize this script #!/bin/bash netstat -ptlen |... (2 Replies)
Discussion started by: vikatakavi
2 Replies

9. Shell Programming and Scripting

Saving nohup output to a file other than nohup.out

Shell : bash OS : Oracle Linux 6.4 I want to save the ouput of a nohup command to file other than nohup.out . Below are my 3 attempts. For both Attempt1 and Attempt2 , the redirection logs the output correctly to the output file. But I get the error "ignoring input and redirecting stderr to... (7 Replies)
Discussion started by: kraljic
7 Replies

10. Shell Programming and Scripting

Help with nohup

I have a script test1.ksh (Korn shell) and within that I am calling another script test2.ksh test2.ksh runs for a pretty long time and hence wanted to execute as nohup from within test1.ksh nohup ./test2.ksh Question 1) dont think the above is working , although executing the nohup... (1 Reply)
Discussion started by: alldbest
1 Replies
ANACRON(8)						       Anacron Users' Manual							ANACRON(8)

NAME
anacron - runs commands periodically SYNOPSIS
anacron [-s] [-f] [-n] [-d] [-q] [-t anacrontab] [job] ... anacron -u [-t anacrontab] [job] ... anacron [-V|-h] DESCRIPTION
Anacron can be used to execute commands periodically, with a frequency specified in days. Unlike cron(8), it does not assume that the machine is running continuously. Hence, it can be used on machines that aren't running 24 hours a day, to control daily, weekly, and monthly jobs that are usually controlled by cron. When executed, Anacron reads a list of jobs from a configuration file, normally /etc/anacrontab (see anacrontab(5)). This file contains the list of jobs that Anacron controls. Each job entry specifies a period in days, a delay in minutes, a unique job identifier, and a shell command. For each job, Anacron checks whether this job has been executed in the last n days, where n is the period specified for that job. If not, Anacron runs the job's shell command, after waiting for the number of minutes specified as the delay parameter. After the command exits, Anacron records the date in a special timestamp file for that job, so it can know when to execute it again. Only the date is used for the time calculations. The hour is not used. When there are no more jobs to be run, Anacron exits. Anacron only considers jobs whose identifier, as specified in the anacrontab matches any of the job command-line arguments. The job argu- ments can be shell wildcard patterns (be sure to protect them from your shell with adequate quoting). Specifying no job arguments, is equivalent to specifying "*" (That is, all jobs will be considered). Unless the -d option is given (see below), Anacron forks to the background when it starts, and the parent process exits immediately. Unless the -s or -n options are given, Anacron starts jobs immediately when their delay is over. The execution of different jobs is com- pletely independent. If a job generates any output on its standard output or standard error, the output is mailed to the user running Anacron (usually root). Informative messages about what Anacron is doing are sent to syslogd(8) under facility cron, priority notice. Error messages are sent at priority error. "Active" jobs (i.e. jobs that Anacron already decided to run and now wait for their delay to pass, and jobs that are currently being exe- cuted by Anacron), are "locked", so that other copies of Anacron won't run them at the same time. OPTIONS
-f Force execution of the jobs, ignoring the timestamps. -u Only update the timestamps of the jobs, to the current date, but don't run anything. -s Serialize execution of jobs. Anacron will not start a new job before the previous one finished. -n Run jobs now. Ignore the delay specifications in the /etc/anacrontab file. This options implies -s. -d Don't fork to the background. In this mode, Anacron will output informational messages to standard error, as well as to syslog. The output of jobs is mailed as usual. -q Suppress messages to standard error. Only applicable with -d. -t anacrontab Use specified anacrontab, rather than the default -V Print version information, and exit. -h Print short usage message, and exit. SIGNALS
After receiving a SIGUSR1 signal, Anacron waits for running jobs, if any, to finish and then exits. This can be used to stop Anacron cleanly. NOTES
Make sure that the time-zone is set correctly before Anacron is started. (The time-zone affects the date). This is usually accomplished by setting the TZ environment variable, or by installing a /usr/lib/zoneinfo/localtime file. See tzset(3) for more information. FILES
/etc/anacrontab Contains specifications of jobs. See anacrontab(5) for a complete description. /var/spool/anacron This directory is used by Anacron for storing timestamp files. SEE ALSO
anacrontab(5), cron(8), tzset(3) The Anacron README file. BUGS
Anacron never removes timestamp files. Remove unused files manually. Anacron uses up to two file descriptors for each active job. It may run out of descriptors if there are more than about 125 active jobs (on normal kernels). Mail comments, suggestions and bug reports to Sean 'Shaleh' Perry <shaleh@(debian.org|valinux.com)>. AUTHOR
Anacron was originally conceived and implemented by Christian Schwarz <schwarz@monet.m.isar.de>. The current implementation is a complete rewrite by Itai Tzur <itzur@actcom.co.il>. The code base is currently maintained by Sean 'Shaleh' Perry <shaleh@(debian.org|valinux.com)>. Sean 'Shaleh' Perry 2000-06-22 ANACRON(8)
All times are GMT -4. The time now is 05:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy