If I put the slashes the correct way, the logs look like THIS....
Apr 7 22:22:39 server2 esmith::event[7152]: Processing event: pre-backup2-custom 575128
Apr 7 22:22:39 server2 e-smith-bg: 7157: tree connect failed: ERRDOS - ERRnosuchshare (You specified an invalid share name)
Apr 7 22:22:39 server2 e-smith-bg: SMB connection failed
Apr 7 22:22:39 server2 e-smith-bg: Error occured mounting //k500/smebackup/ at /etc/e-smith/events/actions/backup2-backup line 96.
The share most definitely exists and has appropiate R/W permissions.
backup2-backup looks like this:
# Syntax: backup2-backup $BackupJob
#
# Copyright (C) 2003-2006 Darrell May <dmay@myezserver.com>
# --------------------------------------------------------------------
my $BackupJob = $ARGV
die "BackupJob argument missing." unless defined ($BackupJob);
$ENV {'QMAILUSER'} = "root";
$ENV {'HOME'} = "/root";
$ENV {'USER'} = "root";
package esmith;
use strict;
use Errno;
use esmith::ConfigDB;
use esmith::util;
# Retrieve db entries
my $db = esmith::ConfigDB->open_ro("backup2");
my $rec = $db->get("$BackupJob");
# Set variables
my $Date = /bin/date +%m.%d.%y;
$Date =~ s/\n//g;
my $Compression = $rec->prop("Compression") || "0";
my $Description = $rec->prop("Description") || "";
my $Destination = $rec->prop("Destination") || "";
my $Exclude = $rec->prop("Exclude") || "";
my @Exclude = split(/,/, "$Exclude");
my $ExcludeList = "/tmp/backup2.$BackupJob.exclude";
my $Expiry = $rec->prop("Expiry") || "";
my $FileSystem = $rec->prop("FileSystem") || "smbfs";
my $IncludeList = "/tmp/backup2.$BackupJob.include";
my $LogFile = "/var/log/backup2/$BackupJob.backup.log";
my $Method = $rec->prop("Method");
my $Mount = $rec->prop("Mount");
my $Password = $rec->prop("Password") || "";
my $Reporting = $rec->prop("Reporting") || "";
my $Size = $rec->prop("Size") || "";
my $Source = $rec->prop("Source") || "";
my @Source = split(/,/, "$Source");
my $Username = $rec->prop("Username") || "";
# rar command options
my $Options="a -idp -ap -dh -ep2 -idc -m$Compression -ol -ow -v$Size" . "m -x\@$ExcludeList";
# -----------------------------------------------------------------------
# Start of generic functions
# -----------------------------------------------------------------------
# Create the inclusion list file
system("/bin/rm -f $IncludeList");
system("/bin/touch $IncludeList");
foreach $Source (@Source)
{
system("/bin/echo $Source >> $IncludeList");
}
# Create the exclusion list file
system("/bin/rm -f $ExcludeList");
system("/bin/touch $ExcludeList");
foreach $Exclude (@Exclude)
{
system("/bin/echo $Exclude >> $ExcludeList");
}
# Launch custom pre-backup2 event
system("/sbin/e-smith/signal-event", "pre-backup2-custom", "$BackupJob") == "0"
or die("Error occured during pre-backup2-custom event");
# Backup mySQL databases
if ("$BackupJob" eq "911")
{
system("/sbin/e-smith/signal-event", "pre-backup2") == "0"
or die("Error occured during pre-backup2 event");
}
# -----------------------------------------------------------------------
# Start of backup2ws specific functions
# -----------------------------------------------------------------------
if ("$Method" eq "backup2ws")
{
# Create the mount point
system("/bin/mkdir -p /mnt/backup2.$BackupJob");
# Mount the Windows/samba share
system("/bin/umount $Destination > /dev/null 2>&1");
system("/bin/mount -t $FileSystem -o username=$Username,password=$Password $Destination /mnt/backup2.$BackupJob") == "0"
or die("Error occured mounting $Destination");
# Create the backup directory
system("/bin/mkdir -p /mnt/backup2.$BackupJob/$BackupJob");
if ("$Expiry" eq "")
{
system("/bin/rm -f /mnt/backup2.$BackupJob/$BackupJob/$BackupJob.*") == "0"
or die("Error occured removing previous backup");
}
else
{
system("/bin/rm -f /mnt/backup2.$BackupJob/$BackupJob/$BackupJob.$Date.*") == "0"
or die("Error occured removing previous backup");
system("/usr/bin/find /mnt/backup2.$BackupJob/$BackupJob/$BackupJob.* -type f -mtime +$Expiry -exec /bin/rm -f {} \\; > /dev/null 2>&1");
}
# Backup using rar
system("/usr/bin/rar $Options -- /mnt/backup2.$BackupJob/$BackupJob/$BackupJob.$Date.rar \@$IncludeList > $LogFile");
# Create report file
my $Report = ("/bin/cat << EOF
# ----------------------------------------------------------------
# backup2 report for $Description, job number $BackupJob:
# ----------------------------------------------------------------
Please review the dates, time and sizes of the following:
Actual backup destination = [ $Destination/$BackupJob ]
/bin/ls -l /mnt/backup2.$BackupJob/$BackupJob/$BackupJob.$Date.*
Log file:
/bin/ls -l $LogFile
End of log file reports:
/usr/bin/tail $LogFile
EOF");
# send report to the administrator
if ("$Reporting" eq "enabled")
{
system("/bin/mail -s \"backup2 for $Description, job\# $BackupJob report\" admin < $Report");
}
# Unmount and remove the mount point
if ("$Mount" eq "unmounted")
{
system("/bin/umount -f /mnt/backup2.$BackupJob");
system("/bin/rmdir /mnt/backup2.$BackupJob");
}
}
# --------------------------------------------------------------------
# Start of backup2usb specific functions
# --------------------------------------------------------------------
if ("$Method" eq "backup2usb")
{
# Mount the USB drive
system("/bin/umount $Destination > /dev/null 2>&1");
system("/bin/mount $Destination") == "0"
or die("Error occured mounting $Destination");
# Create the backup directory
system("/bin/mkdir -p $Destination/$BackupJob");
if ("$Expiry" eq "")
{
system("/bin/rm -f $Destination/$BackupJob/$BackupJob.*") == "0"
or die("Error occured removing previous backup");
}
else
{
system("/bin/rm -f $Destination/$BackupJob/$BackupJob.$Date.*") == "0"
or die("Error occured removing previous backup");
system("/usr/bin/find $Destination/$BackupJob/$BackupJob.* -type f -mtime +$Expiry -exec /bin/rm -f {} \\; > /dev/null 2>&1");
}
# Backup using rar
system("/usr/bin/rar $Options -- $Destination/$BackupJob/$BackupJob.$Date.rar \@$IncludeList > $LogFile");
# Create report file
my $Report = ("/bin/cat << EOF
# ----------------------------------------------------------------
# backup2 report for $Description, job number $BackupJob:
# ----------------------------------------------------------------
Please review the dates, time and sizes of the following:
Actual backup destination = [ $Destination/$BackupJob ]
/bin/ls -l $Destination/$BackupJob/$BackupJob.$Date.*
Log file:
/bin/ls -l $LogFile
End of log file reports:
/usr/bin/tail $LogFile
EOF");
# send report to the administrator
if ("$Reporting" eq "enabled")
{
system("/bin/mail -s \"backup2 for $Description, job\# $BackupJob report\" admin < $Report");
}
# Unmount the mount point
if ("$Mount" eq "unmounted")
{
system("/bin/umount -f $Destination");
}
}
# -----------------------------------------------------------------------
# End of specific functions
# -----------------------------------------------------------------------
# Remove the in/exclude files
system("/bin/rm -f $IncludeList > /dev/null 2>&1");
system("/bin/rm -f $ExcludeList > /dev/null 2>&1");
# Remove mySQL dump
if ("$BackupJob" eq "911")
{
system("/sbin/e-smith/signal-event", "post-backup") == "0"
or die("Error occured during post-backup event");
}
# Launch custom post-backup2 event
system("/sbin/e-smith/signal-event", "post-backup2-custom", "$BackupJob") == "0"
or die("Error occured during post-backup2-custom event");
exit (0);