Bugzilla – Attachment 13922 Details for
Bug 9235
Hardcoded values in cronjobs/backup.sh
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 9235 - Hardcoded values in cronjobs/backup.sh
Bug-9235---Hardcoded-values-in-cronjobsbackupsh.patch (text/plain), 2.21 KB, created by
Kyle M Hall (khall)
on 2012-12-07 14:06:00 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 9235 - Hardcoded values in cronjobs/backup.sh
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2012-12-07 14:06:00 UTC
Size:
2.21 KB
patch
obsolete
>From 06662500e39da6c5274a72a3833383ba44dfd86b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Thu, 6 Dec 2012 16:53:17 -0300 >Subject: [PATCH] Bug 9235 - Hardcoded values in cronjobs/backup.sh > >This patch makes the script read those parameters from the corresponding >$KOHA_CONF file. > >Regards >To+ > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > misc/cronjobs/backup.sh | 20 ++++++++++---------- > 1 files changed, 10 insertions(+), 10 deletions(-) > mode change 100755 => 100644 misc/cronjobs/backup.sh > >diff --git a/misc/cronjobs/backup.sh b/misc/cronjobs/backup.sh >old mode 100755 >new mode 100644 >index fdd6a21..8205c2b >--- a/misc/cronjobs/backup.sh >+++ b/misc/cronjobs/backup.sh >@@ -1,22 +1,22 @@ > #!/bin/sh > # Script to create daily backups of the Koha database. > # Based on a script by John Pennington >+ >+DATABASE=`xmlstarlet sel -t -v 'yazgfs/config/database' $KOHA_CONF` >+HOSTNAME=`xmlstarlet sel -t -v 'yazgfs/config/hostname' $KOHA_CONF` >+PORT=`xmlstarlet sel -t -v 'yazgfs/config/port' $KOHA_CONF` >+USER=`xmlstarlet sel -t -v 'yazgfs/config/user' $KOHA_CONF` >+PASS=`xmlstarlet sel -t -v 'yazgfs/config/pass' $KOHA_CONF` > BACKUPDIR=`xmlstarlet sel -t -v 'yazgfs/config/backupdir' $KOHA_CONF` >-KOHA_DATE=`date '+%y%m%d'` >+KOHA_DATE=`date '+%Y%m%d'` > KOHA_BACKUP=$BACKUPDIR/koha-$KOHA_DATE.sql.gz > >-mysqldump --single-transaction -u koha -ppassword koha | gzip -9 > $KOHA_BACKUP >- >-#mv $KOHA_BACKUP /home/kohaadmin && >-#chown kohaadmin.users /home/kohaadmin/koha-$KOHA_DATE.dump.gz && >-#chmod 600 /home/kohaadmin/koha-$KOHA_DATE.dump.gz && >-# Makes the compressed dump file property of the kohaadmin user. >-# Make sure that you replace kohaadmin with a real user. >+mysqldump --single-transaction --user=$USER --password=$PASS --port=$PORT --host=$HOST $DATABASE| gzip -9 > $KOHA_BACKUP > > if [ -f $KOHA_BACKUP ] ; then >-echo "$KOHA_BACKUP was successfully created." | mail kohaadmin -s $KOHA_BACKUP >+echo "$KOHA_BACKUP was successfully created." | mail $USER -s $KOHA_BACKUP > else >-echo "$KOHA_BACKUP was NOT successfully created." | mail kohaadmin -s $KOHA_BACKUP >+echo "$KOHA_BACKUP was NOT successfully created." | mail $USER -s $KOHA_BACKUP > fi > > # Notifies kohaadmin of (un)successful backup creation >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9235
:
13910
|
13922
|
14221