* Inserting a system reboot in crontab script
@ 1996-11-12 5:00 Benjie Gandionco
1996-11-13 5:00 ` Andreas Woerner t-
` (5 more replies)
0 siblings, 6 replies; 10+ messages in thread
From: Benjie Gandionco @ 1996-11-12 5:00 UTC (permalink / raw)
Is it possible to insert a system reboot in a crontab script?
I want to do a reboot in the middle of a script and then continue
right where it left off.
Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inserting a system reboot in crontab script
1996-11-12 5:00 Inserting a system reboot in crontab script Benjie Gandionco
` (2 preceding siblings ...)
1996-11-13 5:00 ` Mark landin
@ 1996-11-13 5:00 ` Paul D. Chapin
1996-11-18 5:00 ` Michael Mohr
1996-11-14 5:00 ` Simon Wing-Tang
1996-11-18 5:00 ` Benjie Gandionco
5 siblings, 1 reply; 10+ messages in thread
From: Paul D. Chapin @ 1996-11-13 5:00 UTC (permalink / raw)
Benjie Gandionco (benjieg@corp.nsc.com) wrote:
: Is it possible to insert a system reboot in a crontab script?
: I want to do a reboot in the middle of a script and then continue
: right where it left off.
Probably easiest to divide the script into two parts. Have the first
part fire off and reboot the system, and set the second part to start
later, giving the system time to come up again.
--
Paul Chapin
Unix Systems Manager I'm too busy to have time
Amherst College for anything important.
413-542-2144
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inserting a system reboot in crontab script
1996-11-12 5:00 Inserting a system reboot in crontab script Benjie Gandionco
1996-11-13 5:00 ` Andreas Woerner t-
@ 1996-11-13 5:00 ` Jim Zahrndt
1996-11-13 5:00 ` Mark landin
` (3 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Jim Zahrndt @ 1996-11-13 5:00 UTC (permalink / raw)
To: Benjie Gandionco
Benjie Gandionco wrote:
>
> Is it possible to insert a system reboot in a crontab script?
> I want to do a reboot in the middle of a script and then continue
> right where it left off.
>
> Thanks.
The only way I can think of implementing this type of action sequence
is:
1) In your crontab script have the last two lines be like:
touch /etc/LeftOffHere
shutdown -r now
2) In your system startup file/directory (depends on OS)
In /etc/rc.local add a couple of lines like:
if [ -e /etc/LeftOffHere ] then
rm /etc/LeftOffhere
# enter the pathname of the script to execute if
# this circumstance is met or the lines to execute
# to continue on with the original crontab script.
fi
In /etc/rc3.d create a script file similiar to the RC.LOCAL entry.
Hope this helps.
Jim Zahrndt (jzahrndt@cbsofil.com)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inserting a system reboot in crontab script
1996-11-12 5:00 Inserting a system reboot in crontab script Benjie Gandionco
@ 1996-11-13 5:00 ` Andreas Woerner t-
1996-11-13 5:00 ` Jim Zahrndt
` (4 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Andreas Woerner t- @ 1996-11-13 5:00 UTC (permalink / raw)
In article <01bbd05d$a6174760$99d3bb8b@pc-blg.nsc.com>,
"Benjie Gandionco" <benjieg@corp.nsc.com> writes:
>Is it possible to insert a system reboot in a crontab script?
>I want to do a reboot in the middle of a script and then continue
>right where it left off.
Why do you want to boot in the middle of a cron job?
You have the opportunity to create a startup script which continues after the
reboot.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inserting a system reboot in crontab script
1996-11-12 5:00 Inserting a system reboot in crontab script Benjie Gandionco
1996-11-13 5:00 ` Andreas Woerner t-
1996-11-13 5:00 ` Jim Zahrndt
@ 1996-11-13 5:00 ` Mark landin
1996-11-13 5:00 ` Paul D. Chapin
` (2 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Mark landin @ 1996-11-13 5:00 UTC (permalink / raw)
In article <01bbd05d$a6174760$99d3bb8b@pc-blg.nsc.com>, benjieg@corp.nsc.com
says...
>
>Is it possible to insert a system reboot in a crontab script?
>I want to do a reboot in the middle of a script and then continue
>right where it left off.
>
>Thanks.
>
Not that I know of. The reboot part is easy: the pick-up-where-I-left-off is
not -- when you reboot the system has no idea of what is was doing with before
the reboot. Now, you may be able to hack something together: for instance,
your script leaves behind some semaphore (in the form of a particular file
somewhere)....somewhere in your system startup (varies depending on whether
you are 9.x or 10.x) you could have a process that checks to see if this file
exists. If it does, it performs some specific actions and deletes the
semaphore file for next time.
To do this you will go from:
*script A:
commands
REBOOT
more commands
to
*script A:
commands
create "continue" file
REBOOT
*startup:
if "continue" file exists do script B
*script B:
more commands
purge "continue" file
Depending on the exact nature of your task, this may or may not be trivial
--
Mark Landin
UNIX Sys. Admin
TD Williamson, Inc
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inserting a system reboot in crontab script
1996-11-12 5:00 Inserting a system reboot in crontab script Benjie Gandionco
` (3 preceding siblings ...)
1996-11-13 5:00 ` Paul D. Chapin
@ 1996-11-14 5:00 ` Simon Wing-Tang
1996-11-15 5:00 ` Matthew Tovey
1996-11-18 5:00 ` Benjie Gandionco
5 siblings, 1 reply; 10+ messages in thread
From: Simon Wing-Tang @ 1996-11-14 5:00 UTC (permalink / raw)
Benjie Gandionco wrote:
>
> Is it possible to insert a system reboot in a crontab script?
> I want to do a reboot in the middle of a script and then continue
> right where it left off.
>
> Thanks.
I think it is possible, but I'd like to know why you want to do it.
It's not a good idea to reboot the box while your not there, just in
case something goes wrong. That said, here's something that may work.
Split the script into 2 sections, 1 up to the reboot and 1 after the
reboot. Just before the reboot write a temp file to a particular
directory, then sync the disks and issue a reboot. In the system
stratup files add a linr to check for the existance of the file the
script wrote, if it exists then run the second part of the script.
Don't forget to clean up the temp file when finished, still can't think
of why you'd want to reboot in the middle of a script though ?
Simon.
--
--------------------------------------------------------------------
| Simon Wing-Tang |
| Systems Administrator |
| Telstra Learning " If at first you don't succeed.. |
| swingtan@vttsvic1.telecom.com.au use a bigger hammer ! " |
| http://www.alexia.net.au/~www/swt |
| PH: 613-9295-4223 |
--------------------------------------------------------------------
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inserting a system reboot in crontab script
1996-11-14 5:00 ` Simon Wing-Tang
@ 1996-11-15 5:00 ` Matthew Tovey
0 siblings, 0 replies; 10+ messages in thread
From: Matthew Tovey @ 1996-11-15 5:00 UTC (permalink / raw)
Simon Wing-Tang wrote:
>
> Benjie Gandionco wrote:
> >
> > Is it possible to insert a system reboot in a crontab script?
> > I want to do a reboot in the middle of a script and then continue
> > right where it left off.
> still can't think
> of why you'd want to reboot in the middle of a script though ?
We had an occasion where we wanted to install a whole bunch of patches
that required a reboot after each bundle (and on a whole bunch of
machines).
The solution we came up with was to write a script to do this remotely,
using rsh. The script can do some operations, trigger a reboot, wait for
the machine to come back up, then continue.
However, we never used this - instead we managed to create one big
monster-patch-bundle and did it all in one go...
Cheers,
Matt
--
Matt Tovey http://wwwcn.cern.ch/~mtovey
I'm moving flat. Check the web page for new contact details.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inserting a system reboot in crontab script
1996-11-12 5:00 Inserting a system reboot in crontab script Benjie Gandionco
` (4 preceding siblings ...)
1996-11-14 5:00 ` Simon Wing-Tang
@ 1996-11-18 5:00 ` Benjie Gandionco
1996-11-18 5:00 ` Tim Mooney
5 siblings, 1 reply; 10+ messages in thread
From: Benjie Gandionco @ 1996-11-18 5:00 UTC (permalink / raw)
Here's the scenario:
I run the backup with vdump at nights. I first backup to disk since this
is faster and I have to backup more than one file system to tape which I
don't think I can do with a simple vdump. I would have liked to boot to
single-user mode before doing the actual backup, but I found out that the
cron job doesn't continue after switching to single-user mode. So I just
bring the network down before doing the backup. After I backup to disk, I
start up the network so that users can log in. I like my system to start
up clean so I instead opted for a reboot instead of restarting the network.
After this, I ran the backup to tape script. All this is done by cron.
Regarding bringing down the system for backups, I would have liked to keep
the system running, but a key user wanted the system brought down so the
cutoffs for backed up data would be clear, not like when users are still
transacting while doing a backup.
I still have little experience with Unix and any comments on the above
scenario is highly appreciated.
Benjie Gandionco <benjieg@corp.nsc.com> wrote in article
<01bbd05d$a6174760$99d3bb8b@pc-blg.nsc.com>...
> Is it possible to insert a system reboot in a crontab script?
> I want to do a reboot in the middle of a script and then continue
> right where it left off.
>
> Thanks.
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inserting a system reboot in crontab script
1996-11-13 5:00 ` Paul D. Chapin
@ 1996-11-18 5:00 ` Michael Mohr
0 siblings, 0 replies; 10+ messages in thread
From: Michael Mohr @ 1996-11-18 5:00 UTC (permalink / raw)
To: Paul D. Chapin; +Cc: benjieg
Paul D. Chapin wrote:
>
> Benjie Gandionco (benjieg@corp.nsc.com) wrote:
> : Is it possible to insert a system reboot in a crontab script?
> : I want to do a reboot in the middle of a script and then continue
> : right where it left off.
>
> Probably easiest to divide the script into two parts. Have the first
> part fire off and reboot the system, and set the second part to start
> later, giving the system time to come up again.
>
--
Depending on the access to 'at', you might be able to launch the
remaining script as a separate batch job within you script. We do
something similar to ensure that overnight processing is not started
until archive processing is done. Our command is 'at -f nightjobs now +
1 minute'. If you need to create a dynamic (context oriented) job, you
can pipe the followup script into the job. Just make sure you allow
enough time for the reboot to complete before starting the followup.
================================================================
Mike Mohr, Database Administrator === Email: mmohr@ait.ac.nz
Information Technology Group === Phone: 64 9 307-9999 x8133
Auckland Institute of Technology === Fax: 64 9 307-9901
PO Box 92006, Auckland, New Zealand =
================================================================
If we have unlimited ability to think, why do we use computers?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inserting a system reboot in crontab script
1996-11-18 5:00 ` Benjie Gandionco
@ 1996-11-18 5:00 ` Tim Mooney
0 siblings, 0 replies; 10+ messages in thread
From: Tim Mooney @ 1996-11-18 5:00 UTC (permalink / raw)
[posted & mailed]
In article <01bbd4ff$66cbc580$99d3bb8b@pc-blg.nsc.com>,
Benjie Gandionco <benjieg@corp.nsc.com> wrote:
> Here's the scenario:
> Regarding bringing down the system for backups, I would have liked to keep
> the system running, but a key user wanted the system brought down so the
> cutoffs for backed up data would be clear, not like when users are still
> transacting while doing a backup.
If you're using vdump, it sounds like you're using AdvFS. Would clonefset(8)
work for you, or not?
Tim
--
Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu
Information Technology Services (701) 231-1076 (Voice)
Room 242-J1, IACC Building (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~1996-11-18 5:00 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-11-12 5:00 Inserting a system reboot in crontab script Benjie Gandionco
1996-11-13 5:00 ` Andreas Woerner t-
1996-11-13 5:00 ` Jim Zahrndt
1996-11-13 5:00 ` Mark landin
1996-11-13 5:00 ` Paul D. Chapin
1996-11-18 5:00 ` Michael Mohr
1996-11-14 5:00 ` Simon Wing-Tang
1996-11-15 5:00 ` Matthew Tovey
1996-11-18 5:00 ` Benjie Gandionco
1996-11-18 5:00 ` Tim Mooney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox