LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-12-2015, 11:13 PM   #1
preetham.66666
Member
 
Registered: Jan 2015
Posts: 33

Rep: Reputation: Disabled
How to identify process job completed


Hi,

I have a script execute-device.pl and so on. Now i wanted to know when my scripts job completed because this script will take 10 mins, 1hr, 5 hrs, one day even three days we dont know the exact time. I wanted to get report as soon as my script job completed (10 mins delay acceptable). How to identify this? because once i get notify that job is completed i want call another script to generate report.

Thanks in advance
 
Old 01-13-2015, 12:09 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
you may try to send a mail at the end for example. Or create a pid file somewhere and remove it (when completed).
 
Old 01-13-2015, 12:10 AM   #3
Miati
Member
 
Registered: Dec 2014
Distribution: Linux Mint 17.*
Posts: 326

Rep: Reputation: 106Reputation: 106
That depends on how you want to check for it.
Do you want to manually ensure the script has completed and then run the script?

Run the script automatically after the previous script finished?

It would be pretty easy to do something like this:

Code:
./script; echo 'Script Completed!'
 
Old 01-13-2015, 12:25 AM   #4
preetham.66666
Member
 
Registered: Jan 2015
Posts: 33

Original Poster
Rep: Reputation: Disabled
Hi Miati,

1.Run the script automatically after the previous script finished?

yes

2.Do you want to manually ensure the script has completed and then run the script?

please answer 2nd one as well for knowledge.

Thanks
 
Old 01-13-2015, 10:33 AM   #5
Miati
Member
 
Registered: Dec 2014
Distribution: Linux Mint 17.*
Posts: 326

Rep: Reputation: 106Reputation: 106
Quote:
Originally Posted by preetham.66666 View Post
Hi Miati,

1.Run the script automatically after the previous script finished?
To run commands after another in terminal you do it like this:

Code:
command1; command2
It will run regardless of whether the previous one completed successfully or not.
If you want second command to run if the first is success only:
Code:
command1 && command2
Quote:
2.Do you want to manually ensure the script has completed and then run the script?
If you want a file to be created, something like
Code:
command1; echo "Command1 completed" >> command1.log
Would create a file at command1.log saying the above message.

I greatly suggest looking into basic bash syntax if you want to learn how to do this for yourself.

http://en.flossmanuals.net/command-line/index/#
http://commandlinefu.com/
http://vic.gedris.org/Manual-ShellIn...ShellIntro.pdf
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] CUPS - job completed, but no print out on the printer? pielas Linux - Hardware 12 07-11-2017 02:34 PM
seeking config "send email" when print job completed SaintDanBert Linux - Server 3 12-29-2013 11:41 AM
Identify process from PID Juc1 Linux - Newbie 7 10-31-2012 08:12 AM
Syntax for : Receiving email once Cron job is completed Linux_Newbee83 Linux - Newbie 5 01-04-2012 09:11 PM
printer: job completed, no printout slackhack Debian 5 06-04-2006 05:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration