|
[Sponsors] |
automatic shut down the PC after ending of run |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 29, 2013, 18:12 |
automatic shut down the PC after ending of run
|
#1 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
Hi
is there a script or utility so that turn off the computer after end of run automatically?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 30, 2013, 03:11 |
|
#2 |
Senior Member
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16 |
Hi,
in case you're doing single serial runs a simple Code:
sudo shutdown now cutter |
|
August 30, 2013, 03:18 |
|
#3 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
Hi
I want a complete script that turn off the PC when the run ended automatically not manual. then please let me know in parallel cases.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 30, 2013, 03:29 |
|
#4 |
Senior Member
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16 |
Oh sorry,
what I meant is running your simulation like this Code:
$SOLVER && sudo shutdown now |
|
August 31, 2013, 08:29 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@cutter: Sorry, but I think you forgot that sudo will ask for the password after several minutes of not having used sudo. So, no, that won't work In addition, the "&&" implies that the command on the right to it should only be executed if the one on the left finished with success, which might not be the case. It would be a bit annoying if the solver crashed after 30min of falling asleep and the computer stayed on all night WARNING: The following instructions can lead to accidental shutdowns, and respective consequences, when they are not intended! Therefore, use these instructions at your own risk!
Bruno
__________________
|
|
August 31, 2013, 09:17 |
|
#6 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
Hi Bruno thanks
I didn't grasp how to use the command exactly.for example :"rhoCentralFoam && shutdown +5" is true or not use &&? like: "rhoCentralFoam shutdown +5"
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 31, 2013, 09:22 |
|
#7 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Quote:
Code:
blockMesh icoFoam shutdown +5
__________________
|
||
August 31, 2013, 15:16 |
|
#8 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
it mean that I have to open another terminal when run is doing in the folder of case and type in it:shutdown +5 ?
then 5 minutes after finishing of the run the PC will be turned off?! ---------------- I knew what you mean! I have to add this to the script that use for the run,right? if its so,then Code:
rhoCentralFoam shutdown +5
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 31, 2013, 15:28 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Uhm, no.
I guess you're not inspired to work on this today... In my previous example, the respective script would be: Code:
#!/bin/sh # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions runApplication blockMesh runApplication icoFoam shutdown +5 #or even #runApplication shutdown +5
__________________
|
|
August 31, 2013, 15:54 |
|
#10 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
Bruno I use this:
Code:
#!/bin/bash solver=$2 pyFoamPlotRunner.py --hardcopy --non-persist --with-deltat --with-courant --report-usage --report-analyzed-data --procnr=$1 $solver like: Code:
#!/bin/bash solver=$2 pyFoamPlotRunner.py --hardcopy --non-persist --with-deltat --with-courant --report-usage --report-analyzed-data --procnr=$1 $solver shutdown +5
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
September 2, 2013, 02:46 |
|
#11 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
hi Bruno
It didn't turn off,i tested in two times.it goes to a state like hibernate in windows but remains ON.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
September 3, 2013, 16:05 |
|
#12 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Ehsan,
I'll quote myself: Quote:
Quote:
Best regards, Bruno
__________________
|
|||
September 3, 2013, 16:14 |
|
#13 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
Hi Bruno,
then I haven't read that carefully then this should be correct so that it shut down,right? Code:
#!/bin/bash solver=$2 pyFoamPlotRunner.py --hardcopy --non-persist --with-deltat --with-courant --report-usage --report-analyzed-data --procnr=$1 $solver shutdown +5 -p
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
September 3, 2013, 16:20 |
|
#14 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
OK, if I have to detail every step, here goes :
__________________
Last edited by wyldckat; September 3, 2013 at 16:42. Reason: #4 should use the "-H" option |
|
September 3, 2013, 16:53 |
|
#15 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
thanks Bruno,
but the last run is working and ends this morning,I have to get up earlier! then shutdown doesn't mean power off?and "halt" is a state like sleep(or such thing) in windows?whats the benefit of "halt"?! it surely helps some year later I hope !
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
September 4, 2013, 01:13 |
|
#16 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
Hi dear Bruno
shutdown -h and -P worked and powered off the PC,but -H option didn't(only the page with Ubuntu logo shown),is there any preference in using -h or -P options or isn't?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
September 4, 2013, 16:06 |
|
#17 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Whatever works for you, use it. It's that simple.
__________________
|
|
December 24, 2013, 15:44 |
|
#18 | |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
http://www.cfd-online.com/Forums/ope...tml#post449033
dear Bruno,may using shutdown had been causing the problem of lost data? #11: Quote:
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
||
December 25, 2013, 09:14 |
|
#19 | |||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Ehsan,
Quote:
Quote:
In addition, you used the shutdown command, which should be recent enough and should always go through all of the necessary steps for a safe shut-down. The "-h" and the "-P" options are usually the same thing in some systems, since the "-h" is the generic option for "either halt or power down, whichever the system can handle". Neither one should use a forceful shut-down. From my search, I found the following details:
Therefore, the big remaining questions, based on this, are:
Bruno
__________________
|
||||
December 25, 2013, 15:39 |
|
#20 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
Hi dear Bruno,
thanks for nice information and searching, 1-at that time I had a Windows 7 on a partition. 2-I was in Ubuntu and face to lack of space,then moved all files to a NTFS partition, some minutes later I wanted to go to that partition,but it took a long time think of 3-4 minutes and the partition didn't open,then I restarted the PC and when it turned on I saw that that partition doesn't open and instead shows an error message that was saying something about the partition is unmounted(I saw it in Windows and all things was deleted,even in Windows it was showing a message that this partition is corrupted,... I clearly remember),... I remember this was the starting of trouble,then I brought the internal hard(I hadn't any external hard at that time) to the shop and after some days go and come lastly I returned it back to home happily that noticed the partition that was after it has been deleted like previous and after that it was the linux turn,...and other things that you know. 3-now I don't think it was because of shutdown command,because this was aroubd one week or ten days that whenever I wanted to open a huge folder on NTFS partitions(they were data partitions,not XP or 7 partitions) it seemed the PC was becoming locked,even mouse didn't move and this was taking around 1 minute and suddenly it was waking up from a sleep and was continuing to work. at those days I had very stress and wanted to resolve the problem and didn't track the probable causes.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Case running in serial, but Parallel run gives error | atmcfd | OpenFOAM Running, Solving & CFD | 18 | March 26, 2016 12:40 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 04:05 |
What's the best order to run this simulation in? | siw | CFX | 1 | November 4, 2009 19:42 |
serial run fine, but parallel run diverged | phsieh2005 | OpenFOAM Running, Solving & CFD | 2 | October 6, 2009 08:33 |
No results for solid domain | Gary Holland | CFX | 10 | March 13, 2009 03:30 |