Sponsored Content
Top Forums Shell Programming and Scripting How to run Background process one after another Post 302594785 by Navrattan Bansa on Wednesday 1st of February 2012 07:01:43 AM
Old 02-01-2012
How to run Background process one after another

Hii Friends,
I am using Perl CGI. I am running A SCP Command via Perl CGI in Background. Like

Code:
    system("scp -r machinename:/PathOfFile/ /Path/WhereToCopyIt/  &)

This Copy Process takes some times lets say 15 min.
Now I want When This copy process gets complete then send me an email.
But My problem is This command is running in Background So How can i send a mail.
I know how to send Mail but i don't know how to send mail when process is running in Background.
Please help me out?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

capture the process id when starting a background process

Hello all, How do I start a background process and save the process id to a file on my system. For example %wait 5 & will execute and print the process id. I can't figure out how to get it to a file. I've tried: > filename 0>filename 1>filename. Any assistance is most appreciated. Thanks, Jim... (10 Replies)
Discussion started by: jleavitt
10 Replies

2. UNIX for Advanced & Expert Users

make a foreground running process to run background without hang up

I've tried this a long time ago and was successful but could not remember how i did it. Tried ctrl+Z and then used bg % could not figure what i did after to keep it no hangup - not sure if used nohup -p pid, can u plz help me out if this can be done. Any help will be appreciated. (12 Replies)
Discussion started by: pharos467
12 Replies

3. UNIX for Dummies Questions & Answers

can we run ssh2 in background

Hi, I was trying to run ssh2 command in background... but i got follwoing error message saying that process has been stopped.. + Stopped(SIGTTOU) Anyone have any idea about this??? Appreciated your help.. (3 Replies)
Discussion started by: pvamsikr
3 Replies

4. Shell Programming and Scripting

How to process and run a program in the background in perl?

Hi, I have a query about processing and running Perl program at the background. I have HTML file called Userform.html which accepts input from the user. As soon as input is given the contol goes to get.cgi (get.cgi does some processing and computing tasks). Actually get .cgi takes more... (0 Replies)
Discussion started by: vanitham
0 Replies

5. UNIX for Dummies Questions & Answers

Script to start background process and then kill process

What I need to learn is how to use a script that launches background processes, and then kills those processes as needed. The script successfully launches the script. But how do I check to see if the job exists before I kill it? I know my problem is mostly failure to understand parameter... (4 Replies)
Discussion started by: holocene
4 Replies

6. Shell Programming and Scripting

background scripts run-help

Looking for a logic where say i have a script called parent_script which is used to call other 4 to 5 child scripts in background as.. cat parent_script # containing 65 lines 1 2 .. 35 while read child_script 36 do 37 ./child_script_name& 38 done< ${SCRIPT_LISTS} 39 40 # Need to have... (2 Replies)
Discussion started by: michaelrozar17
2 Replies

7. Shell Programming and Scripting

How to put FTP process as a background process/job in perl?

Hi, I am using net::ftp for transferring files now i am trying in the same Linux server as a result ftp is very fast but if the server is other location (remote) then the file transferred will be time consuming. So i want try putting FTP part as a background process. I am unaware how to do... (5 Replies)
Discussion started by: vanitham
5 Replies

8. Shell Programming and Scripting

how to run in background mode.

Hi All, i'm a newbie here, i'm just wondering in how do i run my script in background then echo it if it's done. Please advise, Thanks, -nik (1 Reply)
Discussion started by: nikki1200
1 Replies

9. Shell Programming and Scripting

Make background process interact with fg process

Hi, I have written a menu driven shell script in which as per the choice, I run the another script on background. For eg: 1. get info 2)process info 3)modify info All the operations have different scripts which i schedule in background using &. However I wish to display the error... (0 Replies)
Discussion started by: ashima jain
0 Replies

10. Shell Programming and Scripting

Run scripts in background one by one

Hello all, Can someone help with one script? I have as example 3 scripts 1.sh sleep 60 & sleep 60 & sleep 10 & sleep 80 & sleep 60 & 2.sh sleep 40 & sleep 5 & sleep 10 & sleep 70 & sleep 60 & 3.sh (2 Replies)
Discussion started by: vikus
2 Replies
send(1) 						      General Commands Manual							   send(1)

NAME
send - send a message (only available within the message handling system, mh) SYNOPSIS
send [options] [file...] OPTIONS
Directs send to consult the named files for alias definitions. More than one file, each preceded by -alias, can be named. See mh-alias(4) for more information. Specifies that the current draft is the message to be sent. If you do not give a file argument, send will query whether the current draft is the file that you intend to send. You can suppress this question by using this option. Specifies the draft folder from which the draft message is taken. The send command will search the specified folder for the draft message and will deliver it to the specified recipients. The current message in the named folder is used. If you wish to use another message, you can use the -draftmessage option with -draftfolder. If there is no current draft message in the specified folder, send will display an error message. Specifies the draft message to be used. If you specify a folder with the -draftfolder option, the -draftmessage option takes the number of a message in that folder. If you do not specify a folder, -draftmessage takes the name of a file. If you do not give an absolute pathname (one beginning with / or or ), -draftmessage assumes that the file is located in your Mail directory. Filters (re-formats) messages sent to blind copy recipients. Recipients named in the Bcc: field usually receive a new message which includes a copy of a message sent to the other recipients. If this option is given, this copy of the message is filtered according to the instructions in the named file. The default is -nofilter. Replaces each of the entries in the To: and cc: fields with standard format entries. This standard format is designed to be usable by all of the message handlers on the various systems around the Internet. If -noformat is given, then headers are output exactly as they appear in the message draft. The default is -format. Forwards a copy of a draft message that cannot be sent to the sender. This option can only be used with the -push option. If you have specified -push and the draft message cannot be sent, a failure notice is generated and sent to you. If you also give this option, a copy of the problem message is forwarded with the failure notice. This differs from putting send in the background, because the output is trapped and analyzed by MH. This is the default behavior. It can be suppressed by specifying the -noforward option. Prints a list of the valid options to this command. Adds a Message-ID: field to the mes- sage. Specifies the mail system over which mail is sent. The only value allowed is smtp, which is the standard mail system. Additional values are supported only for use with other mail systems. Instructs send to perform its actions in the background. If a draft fails to be sent, a failure notice is generated and sent to the sender of the problem message. If you also specify the -forward option, the message is forwarded with the failure notice. Informs the user of each step of the sending process, prior to actual delivery. Monitors the delivery of local and network mail. A large amount of information can be gathered about each step of the message's entry into the transport system by specifying both this and the -verbose option. Specifies the length of header lines containing addresses. The defaults for the send command are: file defaults to <mh-dir>/draft alias /usr/lib/mh/MailAliases -nodraftfolder -nofilter -format -forward -nomsgid -mts smtp -nopush -nover- bose -nowatch -width 72 DESCRIPTION
Use send to send the draft message to the specified recipients. You normally choose send as one of the options from the whatnow program. However, you can use send just like any other MH command. If you do not have a draft folder set up, messages are created in a file called draft in your Mail directory. The draft message remains in the file draft until it is either sent or deleted. This means that you can only have one draft message at a time. If you do have a draft folder set up, or if you have specified one using the -draftfolder option, the draft message is created in this folder, which enables you to store multiple draft messages. For more information, see comp(1). The command send will normally search for the draft message in the file draft or in your draft folder and cause it to be delivered to each of the destinations in the To:, cc:, Bcc:, and Fcc: fields of the message. If send is redistributing a message, as invoked from dist, the corresponding Resent-xxx fields are examined instead. The delivery is carried out using post(8). If you wish to send a named file instead of an existing draft message, you can specify the file as the file argument. If you do not give an absolute pathname (one beginning with / or or ) send assumes that the named file is in your directory. Note that the file must be for- matted as a legal mail message. If you want to send an existing mail message rather than a named file, you should use the -draftfolder or -draftmessage option. Once the transport system has successfully received the message, the mail system will rename the file with a leading comma. This allows it to be retrieved until the next draft message is sent. If there are errors in the formatting of the message, send will abort and issue an error message. If the environment variable $SIGNATURE is set, then its value is used as your personal name when constructing the From: line of the mes- sage. If this variable is not set, then send will consult the profile entry Signature: for this information. If send is redistributing a message (when invoked by dist), then the mail system will prepend Resent- to each of these fields: From, Date, and Message-ID. If the message already contains a From: field, then the mail system will add a Sender: user@local field add as well. If an Fcc: field is encountered, the mail system copies the message to the specified folder for the sender in the format in which it appears to any normal recipients of the message. That is, it includes the fields appended by the mail system, and the fields are re-format- ted. The Fcc: fields are removed from all outgoing copies of the message. If the message includes a Bcc: field, recipients in this field receive a new copy of the message, which includes the body text of the orig- inal message. The new message has a minimal set of headers. The Bcc: field does not appear on copies of the message sent to recipients in the To: and cc: fields. Prior to sending the message, the mail system appends Date: and From: to the headers in the message, for example: Date: Wed, 07 June 1989 11:18:00 WET From: rabb@hostname RESTRICTIONS
For this version, the -mts option only supports the value smtp. Additional values are supported for use only with other mail systems. PROFILE COMPONENTS
Path: To determine the user's MH directory Draft-Folder: To determine the default draft folder Signature: To determine the user's mail signature mailproc: Program to post failure notices postproc: Program to post the message FILES
The user profile. SEE ALSO
comp(1), dist(1), forw(1), repl(1), mh-alias(4), post(8) send(1)
All times are GMT -4. The time now is 08:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy