Send Bristol mailing list submissions to
bristol@mailman.lug.org.uk
To subscribe or unsubscribe via the World Wide Web, visit
https://mailman.lug.org.uk/mailman/listinfo/bristol
or, via email, send a message with subject or body 'help' to
bristol-request@mailman.lug.org.uk
You can reach the person managing the list at
bristol-owner@mailman.lug.org.uk
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Bristol digest..."
Today's Topics:
1. Download overnight (Peter Hemmings)
----------------------------------------------------------------------
Message: 1
Date: Sat, 18 Apr 2015 12:59:11 +0100
From: Peter Hemmings <peter@hemmings.eclipse.co.uk>
To: Bristol and Bath Linux User Group <bristol@mailman.lug.org.uk>
Subject: [bristol] Download overnight
Message-ID: <5532470F.70709@hemmings.eclipse.co.uk>
Content-Type: text/plain; charset=windows-1252; format=flowed
Hi,
I am attempting to do the above with the previous information as below:
-------- Forwarded Message --------
Subject: Re: [bristol] How to download overnight?
Date: Mon, 12 Jan 2015 12:33:43 +0000
From: Shane McEwan <shane@mcewan.id.au>
Reply-To: Bristol and Bath Linux User Group <bristol@mailman.lug.org.uk>
To: bristol@mailman.lug.org.uk
On 12/01/15 11:46, Dave Stewart wrote:
> On Sun, 11 Jan 2015, Marc Gray wrote:
>> OK, but I can't have this.
>>
>> sudo bash -c 'su $SUDO_USER -c wget http://url/file.iso; shutdown -h now'
>
> I'm pretty sure that won't work as written. Spotting the mistake is
> left as an exercise for the reader ;-)
The "correct" way to do it is to add:
yourusername ALL=NOPASSWD: /sbin/halt
to the /etc/sudoers file (sudo visudo) so you can halt the machine
without being prompted for a password.
Also, you might not want to halt the machine if wget has an error so use
'&&' rather than ';' between commands:
wget http://url/file.iso && sudo /sbin/halt -p
Alternatively, there are applications like 'kshutdown' and 'sentinella'
that will watch an already running process and perform an action (which
could be a shutdown) when the process finishes.
Shane.
_______________________________________________
Bristol mailing list
Bristol@mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/bristol
My Fedora box uses sysemctl and has a link from /sbin/halt.
How do I halt the machine without a password?
Do I just put "wget http://url/file.iso && sudo /sbin/halt -p" as a cron
job and put the box into sleep and it will work!?
(both 'kshutdown' and 'sentinella' are not in fedora's repositories)
Regards
--
Peter H
------------------------------
_______________________________________________
Bristol mailing list
Bristol@mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/bristol
End of Bristol Digest, Vol 596, Issue 4
***************************************
Tidak ada komentar:
Posting Komentar