using variable instead of full path
[feisty_meow.git] / scripts / archival / snarf_linux_config.pl
index e6a060b17d7c4f44aae4bde0f47928a73e5a2cb8..c6820ace4f104aa67f1528e77337459806e85cdc 100644 (file)
@@ -19,6 +19,13 @@ require "shared_snarfer.pl";
 
 use Env qw(HOME);
 
+# make sure we are running as root.  otherwise we have no access to look at many things in /etc.
+if ($< != 0) {
+  printf "This script must be run as root or sudo.  Try this:\n";
+  printf "  sudo -E PERLLIB=\$PERLLIB perl \$FEISTY_MEOW_SCRIPTS/archival/snarf_linux_config.pl @ARGV\n";
+  exit 1;
+}
+
 &initialize_snarfer;
 
 # get the number we use and increment it for the next use.
@@ -54,11 +61,13 @@ unlink $infofile;
 &backup_files($snarf_file_base, $number, "/", "var/lib/dpkg", ("status*"));
 
 # backup the crucial hierarchies in /var...
-&backup_hierarchy($snarf_file_base, $number, "/", "var/named");
+#gone: &backup_hierarchy($snarf_file_base, $number, "/", "var/named");
+#gone: &backup_hierarchy($snarf_file_base, $number, "/", "var/lib/named/master");
+
 ###not good: &backup_hierarchy($snarf_file_base, $number, "/", "var/lib/mysql");
 ###the mysql snarf is not necessarily usable, since we really should be
 ###backing up the databases by another means than this.
-&backup_hierarchy($snarf_file_base, $number, "/", "var/lib/named/master");
+
 &backup_hierarchy($snarf_file_base, $number, "/", "var/lib/webalizer");
 
 # snag the grub bootloader files.