Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: Linux terminal One-Liners

__/ [ Ian Semmel ] on Wednesday 22 February 2006 21:15 \__

> 
> 
> Roy Schestowitz wrote:
>> __/ [ The Ghost In The Machine ] on Wednesday 22 February 2006 17:00 \__
>> 
>> 
>>>In comp.os.linux.advocacy, Roy Schestowitz
>>><newsgroups@xxxxxxxxxxxxxxx>
>>> wrote
>>>on Wed, 22 Feb 2006 06:17:33 +0000
>>><dtgvoj$8eo$1@xxxxxxxxxxxxxxxxx>:
>>>
>>>>http://www.opentechsupport.net/forums/archive/topic/20438-1.html
>>>
>>>    Shit!  Too complicated!  Where's my GUI?  Where's the
>>>    ease of use?  I wanna mouseclick!  WAAAAAH!
>>>
>>>- hypothetical response from a frustrated Windows user
>>>
>>>;-)
>>>
>>>There are a fair number of additional pipelining options,
>>>however -- date in particular can print an arbitrary format.
>>>But that's what manpages are for. :-)
>> 
>> 
>> Here's one of my latest script:
>> 
>> cd /tmp/   # need full path for cron
>> rm -rf /home/roy/public_html/wordpress #
>> wget http://static.wordpress.org/builds/wordpress-`date +%Y-%m-%d`.tar.gz
>> rm /tmp/wordpress-`date +%Y-%m-%d`.tar # delete
>> gunzip /tmp/wordpress-`date +%Y-%m-%d`.tar.gz
>> tar xf /tmp/wordpress-`date +%Y-%m-%d`.tar # uncompress and untar
>> cp -rf /tmp/wordpress /home/roy/public_html/ # overwrite old files
>> rm -rf /tmp/wordpress # clean up
>> 
>> Without using semi-colons, it could still be shrunk to occupy just 4 lines
>> or so. What does it do? It goes to the WordPress site, it finds the latest
>> nightly  build, it then downloads it, uncompresses the file, extracts  all
>> the  files, puts them on a public Webspace and optionally protects  every-
>> thing.
>> 
>> Imagine  yourself doing all of this in Windows rather than let a cron  job
>> keep  the Web-based software up-to-date, /without/ having /any/ such func-
>> tionality at software-level.
>> 
>> The command-line gives power. If the newbie does not want to be efficient,
>> (s)he  can  use the GUI. It's there, so use it. It has become a  streotype
>> and  a  fallacy: Linux users choose the command-line, so the  command-line
>> must  be  vital. If you want to burn CD's with nightly copies of your  Web
>> sites  and  then  open the CD tray in the morning, script it.  *Once*.  OR
>> click your way through life instead. Day, by day, by day...
>> 
>> Roy
>> 
> Could you show us the amended code to
> - Stop the job if it runs for more than 10 minutes


It already does that. wget has a timeout threshold, which you are free to
alter.


> - Only start the job if the computer has been idle for 20 minutes and
> - Stop the job if battery mode begins


the computer is always idle when this jobs is scheduled to start. If you want
finer control, you could use the front ends, which /do/ exist. The
command-line is simply more /concise/. It involves copying and pasting, not
importing and exporting of some opaque binaries (if any exist at all).


> Of course, you could always start a scheduled task on windows to do it, but
> that would be too hard as it involves the use of a mouse and a gui.


There are front ends to scheduled processes in Linux. I just didn't choose to
use them. See the subject line of this thread. If I wanted to give a GUI
'recipe', I'd discuss these under an "ease-of-use" thread, which illustrates
a low barrier of entry, not power.

Best wishes,

Roy

-- 
Roy S. Schestowitz      |    Useless fact: Digits 772-777 of Pi are 999999
http://Schestowitz.com  |    SuSE Linux     |     PGP-Key: 0x74572E8E
  4:10am  up 5 days 16:29,  8 users,  load average: 0.34, 0.60, 0.76
      http://iuron.com - next generation of search paradigms

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index