Koozali.org: home of the SME Server

Troubleshoot Flexbackup to disk

David Sainsbury

Troubleshoot Flexbackup to disk
« on: January 27, 2003, 02:25:51 PM »
I have followed the "Flexbackup to disk" how to pedantically with one mod. I changed it to backup to an atapi zip drive which I entered in fstab and can use normally from the cli. The automated backup won't work and on viewing the message logs I see these errors:

Jan 27 18:31:51 Fileserver e-smith[1598]: Running event handler: /etc/e-smith/events/conf-backup/S10conf-backup
Jan 27 18:31:54 Fileserver e-smith[1598]: ERROR in /etc/e-smith/templates-custom//etc/cron.d/backup/backup: Program fragment delivered error <Jan 27 18:31:54 Fileserver e-smith[1598]: ^I    .">> at template line 1
Jan 27 18:31:54 Fileserver e-smith[1598]: ERROR: Template processing failed for //etc/cron.d/backup: 1 fragment generated errors
Jan 27 18:31:54 Fileserver e-smith[1598]:  at /etc/e-smith/events/conf-backup/S10conf-backup line 46
Jan 27 18:31:54 Fileserver e-smith[1598]: S10conf-backup=action|Event|conf-backup|Action|S10conf-backup|Start|1043652711 687625|End|1043652714 197763|Elapsed|2.510138|Status|65280
Jan 27 18:31:54 Fileserver e-smith[1598]: Running event handler: /etc/e-smith/events/conf-backup/S65conf-flexbackup
Jan 27 18:31:56 Fileserver e-smith[1598]: S65conf-flexbackup=action|Event|conf-backup|Action|S65conf-flexbackup|Start|1043652714 198793|End|1043652716 887653|Elapsed|2.68886
Jan 27 18:35:21 Fileserver e-smith[1634]: Processing event: BackupNow
Jan 27 18:35:21 Fileserver e-smith[1634]: Running event handler: /etc/e-smith/events/BackupNow/S10BackupNow
Jan 27 18:35:22 Fileserver e-smith[1638]: Processing event: pre-backup
Jan 27 18:35:22 Fileserver e-smith[1638]: Running event handler: /etc/e-smith/events/pre-backup/S10mysql-delete-dumped-tables
Jan 27 18:35:22 Fileserver e-smith[1638]: S10mysql-delete-dumped-tables=action|Event|pre-backup|Action|S10mysql-delete-dumped-tables|Start|1043652922 462535|End|1043652922 788426|Elapsed|0.325891
Jan 27 18:35:22 Fileserver e-smith[1638]: Running event handler: /etc/e-smith/events/pre-backup/S20mysql-dump-tables
Jan 27 18:35:24 Fileserver e-smith[1638]: S20mysql-dump-tables=action|Event|pre-backup|Action|S20mysql-dump-tables|Start|1043652922 789444|End|1043652924 808802|Elapsed|2.019358
Jan 27 18:35:24 Fileserver e-smith[1638]: Running event handler: /etc/e-smith/events/pre-backup/S25gentle-ldap-dump
Jan 27 18:35:26 Fileserver e-smith[1638]: S25gentle-ldap-dump=action|Event|pre-backup|Action|S25gentle-ldap-dump|Start|1043652924 809682|End|1043652926 849994|Elapsed|2.040312
Jan 27 18:35:26 Fileserver e-smith[1634]: Backup aborted: No tape loaded

as well as receiving admin emails that "No tape loaded".
Can anyone help me to troubleshoot please?!

Des Dougan

Re: Troubleshoot Flexbackup to disk
« Reply #1 on: January 28, 2003, 06:41:29 AM »
Not sure of the impact, but I see two consecutive //s in your log.

Can you post the cron.d backup file?


Des Dougan

Jon Blakely

Re: Troubleshoot Flexbackup to disk
« Reply #2 on: January 28, 2003, 12:23:27 PM »
David,

You have a syntax error on line 40 of
/etc/e-smith/templates-custom/etc/cron.d/backup/backup

How about cutting and pasting the script on the board.

Jon

David Sainsbury

Re: Troubleshoot Flexbackup to disk
« Reply #3 on: January 28, 2003, 04:20:07 PM »
Here is the /etc/e-smith/templates-custom/etc/cron.d/backup/backup script. I edited the original exactly as per the "How to".
{
    use POSIX;
    use Locale::gettext;

    my $lang = $sysconfig{Language} || 'en_US';
    $ENV{'LANG'} = $lang;
    $ENV{'LANGUAGE'} = $lang;
    bindtextdomain('backup', '/usr/share/locale');
    textdomain('backup');
    setlocale(LC_MESSAGES, "");

    $OUT = '';

    my $status = $backup{status};

    if (defined $status && $status eq 'enabled')
    {
   my $device = $backup{Device} || "/dev/nst0";

   # configure backup time and reminder times from the configuration
   # database

   my $backupMin;
   my $backupHour;
   my $reminderMin;
   my $reminderHour;

   my $backupTime = $backup{backupTime} || "2:00";
   my $reminderTime = $backup{reminderTime} || "14:00";

   ($backupHour, $backupMin) = split (":", $backupTime, -1);
   ($reminderHour, $reminderMin) = split (":", $reminderTime, -1);

   # remove leading zeros from minutes

   $backupMin =~ s/00/0/;
   $reminderMin =~ s/00/0/;

   $OUT .=
       . "$backupMin $backupHour * * * root"
       . " /sbin/e-smith/backup"
    }
    else
    {
   $OUT .= "# ",gettext("Backup task is disabled");
    }
}

Only this section:

$OUT .=
       . "$backupMin $backupHour * * * root"
       . " /sbin/e-smith/backup"

was changed. I noticed the "//" in the log as well but assumed it was just the way it was recorded in the log, because I checked the directory structure and it is all intact. BTW thanks for the replies.
This also appears in the log inreference to the above script, which just doesn't make sense to me:

Jan 28 22:30:57 Fileserver e-smith[1762]: ERROR in /etc/e-smith/templates-custom//etc/cron.d/backup/backup: Program fragment delivered error <Jan 28 22:30:57 Fileserver e-smith[1762]: ^I    .">> at template line 1
Jan 28 22:30:57 Fileserver e-smith[1762]: ERROR: Template processing failed for //etc/cron.d/backup: 1 fragment generated errors
Jan 28 22:30:57 Fileserver e-smith[1762]:  at /etc/e-smith/events/conf-backup/S10conf-backup line 46

Des Dougan

Re: Troubleshoot Flexbackup to disk
« Reply #4 on: January 30, 2003, 08:12:22 AM »
David,

In your changes:

$OUT .=
. "$backupMin $backupHour * * * root"
. " /sbin/e-smith/backup"

There should not be a period at the beginning of the second line. Change that and let us know how it goes.


Des Dougan

David Sainsbury

Re: Troubleshoot Flexbackup to disk
« Reply #5 on: January 30, 2003, 02:52:50 PM »
Thanks Des. All that was stopping me was that little DOT. It all works perfectly now. I guess I didn't follow your "how-to" as carefully as I thought, and just literally DELETED the lines before the offending period with no thought for continuity of syntax.
BTW, would you know a quick and SME safe way to change the automatic backup to only include the same as the "Backup to desktop" ?
And thanks again for your time and also the "how-to", which was very helpful.

David Sainsbury

Re: Troubleshoot Flexbackup to disk
« Reply #6 on: January 30, 2003, 03:04:08 PM »
Actually, as I am not that fantastic at scripting, could you suggest a mod to delete everything on the disk before starting the backup?

Des Dougan

Re: Troubleshoot Flexbackup to disk
« Reply #7 on: January 31, 2003, 06:53:00 AM »
David,

It sounds like Stephen Noble's adjusted backup is what you're looking for. See http://dungog.net/sme/howto/backup.php for details.

Des

elenezet

Re: Troubleshoot Flexbackup to disk
« Reply #8 on: February 20, 2003, 07:28:01 PM »
hello,

I use this how to and i would like to have a script that delete files that are older that X days.
thanks in advance
elenezet