Ich hab ein update-Script geschrieben, mit dem man eine vorhandene serendipity (und wahrscheinlich auch andere Installationen) updaten kann. Unter Angabe der existierenden Installation und eines neuen Releases als Archiv, legt es vorher verschiedene Backups an und updated die gegebene Installation.
Ich habe versucht es so generell wie möglich zu halten und dennoch
relativ einfach zu bedienen.
Da bei meiner Installation jedoch root-Rechte benötigt werden, besteht es auf einem Aufruf als root. Dennoch sollte es theoretisch möglich sein, damit jede andere Installation upzudaten, ich garantiere jedoch für nichts.
Der Aufruf dann folgendermaßen, hier mal beispielhaft:
Code: Select all
$ ~/bin/s9yupdate-sh -h
s9y_update.sh [-s|-h|-?|-u] <DIR> <ARCHIV>
s9y_update.sh will take the archive <ARCHIV> to update your installation
in <DIR>. Unless the option -s is given, it will not do anything just tell
you, what it would do.
Please carefully control the actions, I will not take any responsibility!
-s do not simulate but really update my installation
-u restore the last backup
The variables on top of the script can also be set by a configuration file
in ~/.s9y_update.rc.
$ ls ~/script_test
backup_blog <- Hierhin wird gesichert (konfigurierbar)
serendipity-1.0.3a.tar.gz <- Das neue Archiv
testblog <- Die vorhandene Installation
$ sudo ~/bin/s9yupdate.sh -s ~/script_test/testblog
~/script_test/serendipity-1.0.3a.tar.gz
Archiving old backups of ~/script_test/testblog
Backing up old installation...
Archiving old installation in /home/chrisbra/script_test/backup_blog/
19476 blocks
Removing temporary directory
You might need to finish the installation by visiting you blog homepage
via a browser
$ ls -m ~/script_test
backup_blog serendipity-1.0.3a.tar.gz testblog testblog.20061205
^ ^ ^ ^
| | | Kopie der
| | | Installation
| | |
| | upgedate Installation
| |
| Archiv des installierten Updates
|
Verzeichnis, in dem sich ein weiteres Backup der vorherigen
Installation befindet (diesmal als .tar.bz2)
Einfach die Variablen am Anfang passend setzen (alternativ lassen sich diese Variablen auch über eine .s9yupdate.rc Datei steuern).
Aber bitte vorher gut testen, ich übernehme keine Verantwortung (es funktioniert jedoch bei mir problemlos).