PDA

View Full Version : Here's my "get the latest build" script



spblat
2005-10-02, 21:45
Hey folks:

I wrote a very simple script today (attached) that does the following:

- Downloads and untars the latest nightly 6.2 build
- Creates a symlink to the new build at /usr/local/slimserver
- Kills yesterday's version's daemon
- Starts the new version as a daemon

It's a quick hack, may be redundant, isn't customizable (unless you change the code directly) and probably isn't bug free. But I like it. It's my inconsequential way of saying thanks for the magic that is SlimServer. It's probably suitable for putting in a daily cron, but I do it manually.

Rename to .pl, or just remove the extension and chmod +x, and use at your own risk. Share and enjoy!

chris
2005-10-02, 23:34
Here's one that does the same with the RPM version (edit your paths as appropriate):


#!/bin/sh

Filename="slimserver-20$(date +%y)_$(date +%m)_$(date +%d)-1.noarch.rpm"

cd /root/scripts
rm -f *.rpm
wget -Y off -C off -q http://www.slimdevices.com/downloads/nightly/latest/6.2/
$Filename
rpm -U $Filename
chmod -R ugo+w /usr/local/slimserver/

Robin Bowes
2005-10-03, 01:28
spblat wrote:
> Hey folks:
>
> I wrote a very simple script today (attached) that does the following:
>
> - Downloads and untars the latest nightly 6.2 build
> - Creates a symlink to the new build at /usr/local/slimserver
> - Kills yesterday's version's daemon
> - Starts the new version as a daemon

If you're downloading nightlies regularly you're much better off using
subversion to get the latest updates.

Assuming you already have a nightly or rpm version installed in
/usr/local/slimserver, here's what to do:

login as slimserver
cd /home/slimserver
svn co http://svn.slimdevices.com/repos/slim/trunk
su -
service slimserver stop (or /etc/init.d/slimserver stop)
cd /usr/local
mv slimserver slimserver.001
ln -s /home/slimserver/trunk/server/ slimserver
service slimserver start (or /etc/init.d/slimserver start)

That's it.

Now, all you need to do to update to the latest revision is:

login as slimserver
cd /home/slimserver/trunk
svn up
su -
service slimserver restart

R.
--
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?

dean
2005-10-03, 08:32
This is the cron entry I have to do essentially the same thing:

0 2 * * * rpm --force -U -v http://www.slimdevices.com/downloads/
nightly/SlimServer_v`date +\%Y-\%m-\%d`/slimserver-`date +\%Y_\%m_\%
d`-1.noarch.rpm

And I get a nice email every morning telling me if it happened. :)


On Oct 2, 2005, at 11:34 PM, chris wrote:

>
> Here's one that does the same with the RPM version:
>
>
> Code:
> --------------------
> #!/bin/sh
>
> Filename="slimserver-20$(date +%y)_$(date +%m)_$(date +%
> d)-1.noarch.rpm"
>
> cd /root/scripts
> rm -f *.rpm
> wget -Y off -C off -q http://www.slimdevices.com/downloads/
> nightly/latest/6.2/
> $Filename
> rpm -U $Filename
> chmod -R ugo+w /usr/local/slimserver/
> --------------------
>
>
> --
> chris
>

mherger
2005-10-03, 11:58
> date +\%Y-\%m-\%d

That got me thinking about my lousy update script I'm currently using on
SlimCD... Is there a parameter to automatically respect the difference
regarding the time zone? I can't use your methode as I'me 8h(?) ahead of
your time.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)