How to use 'nohup' and 'at' commands collectively?
I have a unix script named 'test1' and it can be run using parameters say a, b and c. i.e. the command would be
this script gives the output in the log file as
Now, i want to run this batch at some later time. say i want to run it at 2:00 am in the night when no one is there in the office. so i am giveing the command as
I fire this command and close the session. The next day when i come to the office I see that the log file is showing me below output
Thus the script starts as soon as fired and it stops running as soon as i close the session.
please help me in resolving this. please also let me know if my issue is not clear.
regards,
Swapnil
Last edited by Scott; 04-08-2011 at 03:04 PM..
Reason: Please use code tags for code, data files, terminal output, etc.
By putting it in backticks, you're running this 'test1' command immediately.
-f doesn't take parameters and doesn't take commands. It takes a bourne script file and nothing but a bourne script file.
nohup is redundant here, running something by at instead is at least as good as it by itself. 'at' doesn't stick around. The command just hands off your request to the at daemon then quits. the at daemon itself will run the command later, quite independent of your own session.
Without the full path, it may have no idea where test1 is. It may not have the full PATH you're used to so specify an absolute path.
Fortunately you can avoid having to create a script file to feed it a command in. Try:
It's usually not a good idea to name scripts 'test'. There's already a 'test' command that you don't want it confused with.
Last edited by Corona688; 04-07-2011 at 02:19 PM..
I tried with the given command but it is giving the error as 'date is not in the correct format'.
I also tried with the below commands:
but its giving the syntax error.
Good afternoon:
I need your help please, Im new at Unix nd specially Unix applicationas like oracle and Ive got this problem:
I was asked to execute the next script using nohup in order to not hang up the session because it was supposed to connect to the database and then insert about 2... (3 Replies)
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)
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)
Hi all,
I'm new in this forum.
I'm looking for the difference between the HACMP commands with the prefix "cl" and "cli".
The first type are under /usr/es/sbin/cluster/sbin directory and the second are under /usr/es/sbin/cluster/cspoc directory.
I know that the first are called HACMP for AIX... (0 Replies)
hi
I want to use nohup command with set of commands ..
my goofy sample :
nohup while true do ; date; done
and its not working .
any idea ?
cheers (1 Reply)
I need to run multiple commands on remote server using the nohup...
I have tried 2 options
1) rsh <SERVER_NAME> -n "nohup perl $SCRIPTS_DIR/abc.pl ; $SCRIPTS_DIR/xyz.ksh & " &
2) rsh <SERVER_NAME> -n "nohup perl $SCRIPTS_DIR/abc.pl & nohup $SCRIPTS_DIR/xyz.ksh & " &
I need to know if... (2 Replies)
I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config.
I am not sure if I can do this with BASH scripting.
I have set up password less login by adding my public key to authorized_keys file, it works.
I am a little... (1 Reply)
Hello,
I just want to ask if killing a specific procees might delete files being read of that process?
Here is the scenario: I execute nohup find . -type f |xargs ls -lrt > nohup1.out &
I noticed that it is taking so much space, I check that there are files so huge
.nfs* and keep on... (2 Replies)
Hello all,
i've written a small piece of code that will read commands from standard input and executes the commands.
Its working fine and is execting the commands well. Accepting arguments too. e.g
#mkdir <name of the directory>
The problem is that its not letting me change the directory i.e... (4 Replies)
Why would anyone ever type in a command like this:
nohup command &
nohup lets you logout of your telnet session so why add "&" to run it in the background? (1 Reply)