[Box Backup-commit] COMMIT r2063 - in box/trunk/bin: bbackupd bbstored

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Mon, 28 Jan 2008 23:58:35 +0000 (UTC)


Author: chris
Date: 2008-01-28 23:58:35 +0000 (Mon, 28 Jan 2008)
New Revision: 2063

Modified:
   box/trunk/bin/bbackupd/bbackupd-config.in
   box/trunk/bin/bbstored/bbstored-config.in
Log:
Use @sysconfdir_expanded@ as default location for configuration files,
instead of /etc/box. Thanks to Eric Cronin for pointing this out.

Likewise, use @localstatedir_expanded@ as default location for temporary
state (*.pid and bbackupd.sock), defaults to /usr/local/var, although
/var/run may be better on LFS systems.

Likewise, use @bindir_expanded@ for binaries.

Reformat usage text for readability.

Remove the message that "Directories not checked against mountpoints",
as they now are.

Report the type of the unrecognised message in the "unknown error" part
of the default NotifyScript.


Modified: box/trunk/bin/bbackupd/bbackupd-config.in
===================================================================
--- box/trunk/bin/bbackupd/bbackupd-config.in	2008-01-28 23:54:29 UTC (rev 2062)
+++ box/trunk/bin/bbackupd/bbackupd-config.in	2008-01-28 23:58:35 UTC (rev 2063)
@@ -15,15 +15,19 @@
 
 Bad command line parameters.
 Usage:
-	bbackupd-config config-dir backup-mode account-num server-hostname working-dir backup-dir [more backup directories]
+    bbackupd-config config-dir backup-mode account-num server-hostname
+        working-dir [backup directories]
 
-config-dir usually /etc/box
-backup-mode is lazy or snapshot
-    lazy mode runs continously, uploading files over a specified age
-    snapshot mode uploads a snapshot of the filesystem when instructed explicitly
-account-num (hexdecimal) and server-hostname as supplied from the server administrator
-working-dir usually /var/bbackupd
-backup-dir, list of directories to back up
+Parameters:
+    config-dir          is usually @sysconfdir_expanded@/box
+    backup-mode         is lazy or snapshot:
+        lazy mode       runs continously, uploading files over a specified age
+        snapshot mode   uploads a snapshot of the filesystem when instructed
+                        explicitly, using bbackupctl sync
+    account-num (hexdecimal) and server-hostname
+                        are supplied by the server administrator
+    working-dir         is usually @localstatedir_expanded@
+    backup directories  is list of directories to back up
 
 __E
 	print "=========\nERROR:\n",$_[0],"\n\n" if $_[0] ne '';
@@ -53,7 +57,7 @@
 }
 
 # default locations
-my $default_config_location = '/etc/box/bbackupd.conf';
+my $default_config_location = '@sysconfdir_expanded@/box/bbackupd.conf';
 
 # command line parameters
 my ($config_dir,$backup_mode,$account_num,$server,$working_dir,@tobackup) = @ARGV;
@@ -127,8 +131,6 @@
 they will NOT be backed up. You will have to create separate locations for
 any mounted filesystems inside your backup locations.
 
-WARNING: Directories not checked against mountpoints. Check mounted filesystems manually.
-
 __E
 
 # create directories
@@ -269,7 +271,7 @@
 To: \$SENDTO
 
 
-The backup daemon on $hostname reported an unknown error.
+The backup daemon on $hostname reported an unknown error (\$1).
 
 ==========================
 FILES MAY NOT BE BACKED UP
@@ -430,7 +432,7 @@
 
 # Where the command socket is created in the filesystem.
 
-CommandSocket = /var/run/bbackupd.sock
+CommandSocket = $working_dir/bbackupd.sock
 
 # Uncomment the StoreObjectInfoFile to enable the experimental archiving
 # of the daemon's state (including client store marker and configuration)
@@ -443,7 +445,7 @@
 
 Server
 {
-	PidFile = /var/run/bbackupd.pid
+	PidFile = $working_dir/bbackupd.pid
 }
 
 
@@ -563,7 +565,7 @@
 
 4) You may wish to read the configuration file
       $config_file
-   and adjust as appropraite.
+   and adjust as appropriate.
    
    There are some notes in it on excluding files you do not
    wish to be backed up.
@@ -575,7 +577,7 @@
    more files will be backed up. You want to know about this.
 
 6) Start the backup daemon with the command
-      /usr/local/bin/bbackupd$daemon_args
+      @bindir_expanded@/bbackupd$daemon_args
    in /etc/rc.local, or your local equivalent.
    Note that bbackupd must run as root.
 __E
@@ -585,7 +587,7 @@
 
 7) Set up a cron job to run whenever you want a snapshot of the
    file system to be taken. Run the command
-      /usr/local/bin/bbackupctl -q$ctl_daemon_args sync
+      @bindir_expanded@/bbackupctl -q$ctl_daemon_args sync
 __E
 }
 print <<__E;

Modified: box/trunk/bin/bbstored/bbstored-config.in
===================================================================
--- box/trunk/bin/bbstored/bbstored-config.in	2008-01-28 23:54:29 UTC (rev 2062)
+++ box/trunk/bin/bbstored/bbstored-config.in	2008-01-28 23:58:35 UTC (rev 2063)
@@ -16,12 +16,15 @@
 
 Bad command line parameters.
 Usage:
-	bbstored-config config-dir server-hostname username [raidfile-config]
+    bbstored-config config-dir server-hostname username [raidfile-config]
 
-config-dir usually /etc/box
-server-hostname is the hostname used by clients to connect to this server
-username is the user to run the server under
-raidfile-config is optional. Use if you have a non-standard raidfile.conf file.
+Parameters:
+    config-dir       is usually @sysconfdir_expanded@/box
+    server-hostname  is the hostname that clients will use to connect to
+                     this server
+    username         is the user to run the server under
+    raidfile-config  is optional. Use if you have a non-standard
+                     raidfile.conf file.
 
 __E
 	exit(1);
@@ -44,7 +47,7 @@
 }
 
 # default locations
-my $default_config_location = '/etc/box/bbstored.conf';
+my $default_config_location = '@sysconfdir_expanded@/box/bbstored.conf';
 
 # command line parameters
 my ($config_dir,$server,$username,$raidfile_config) = @ARGV;
@@ -193,7 +196,7 @@
 
 Server
 {
-	PidFile = /var/run/bbstored.pid
+	PidFile = @localstatedir_expanded@/bbstored.pid
 	User = $username
 	ListenAddresses = inet:$server
 	CertificateFile = $certificate
@@ -231,7 +234,7 @@
 4) Create accounts with bbstoreaccounts
 
 5) Start the backup store daemon with the command
-      /usr/local/bin/bbstored$daemon_args
+      @bindir_expanded@/bbstored$daemon_args
    in /etc/rc.local, or your local equivalent.
 
 ===================================================================