#!/usr/bin/perl ############################################################################### # # # Name : bob_lists # # Author : Chris Koeritz # # Rights : Copyright (C) 2000-$now by Author # # # # Purpose: # # # # Stuffs up an archive with quartz lists and current new notes. # # # ############################################################################### # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # # Software Foundation; either version 2 of the License or (at your option) # # any later version. See: "http://www.gruntose.com/Info/GNU/GPL.txt" for a # # version of the License. Please send any updates to "fred@gruntose.com". # ############################################################################### require "bobber.pl"; require "importenv.pl"; use Cwd; $original_path = cwd(); # set the log file name. #todo: have a shell-wide debugging flag. #local($log) = "$TMP/back_shl.log"; #if (-f $log) { unlink $log; } local($log) = ""; #todo: add a 'create bob archive' function that takes these parms. # get the number we use and increment it for the next use. local($number) = &retrieve_number("backup"); # variables for directory location to backup and the file to dump it in. local($root) = "$HOME"; local($date_cmd) = "date +%m-%d-%G-%H%M"; local($base) = "lists_" . &short_hostname() . "_" . `$date_cmd`; chop $base; local($bob_file) = &bob_name($base, $number); # store the current archive number in the bob file for retrieval on the # other side. &backup_number("backup", $base, $number); ############################################################################ # get top level text files too... these might be important. &backup_files($base, $number, $log, "$root", ("*.txt")); # backup all the items in our lists directory. foreach $item (&glob_list("$root/quartz/lists")) { &backup_hierarchy($base, $number, $log, $item); } # backup all the records, which are mainly passcodes. foreach $item (&glob_list("$root/quartz/records")) { &backup_hierarchy($base, $number, $log, $item); } # snag the records held on the zaurus for kdepim. foreach $item (&glob_list("/home/zaurus/kdepim")) { &backup_hierarchy($base, $number, $log, $item); } # now grab any current new notes from our heuristically chosen location. @notes = &glob_list(("$root/*notes*", "$STUFFING/*notes*")); if ("@notes" eq "") { print "no notes directores were backed up in $HOME.\n"; } foreach $item (@notes) { &backup_hierarchy($base, $number, $log, $item); } # zip up any projects that happen to be lying around. @projectiles = &glob_list(("$root/*project*")); if ("@projectiles" eq "") { print "no project directores were backed up in $HOME.\n"; } foreach $item (@projectiles) { &backup_hierarchy($base, $number, $log, $item); } # zip up anything marked as crucial. @cruciatus = &glob_list(("$root/*crucial*")); if ("@cruciatus" eq "") { print "no crucial directores were backed up in $HOME.\n"; } foreach $item (@cruciatus) { &backup_hierarchy($base, $number, $log, $item); } # zip up list directories lying around in our home. @listoolia = &glob_list(("$root/list_*")); if ("@listoolia" eq "") { print "no list directores were backed up in $HOME.\n"; } foreach $item (@listoolia) { &backup_hierarchy($base, $number, $log, $item); } #todo: add a 'close bob archive' for these steps... # now rename the file so only the unpacker can access it. &rename_archive($bob_file); exit 0;