[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 534
  • Last Modified:

Rsync an email server

Howdy,
I am looking to setup a Rsync backup of a sendmail server running on Ubuntu.  I would like to send the backup to a NAS on the network.

I tried the following command but it does not appear to be sending to the NAS though the command appears to be processing (so I believe maybe its backing up locally instead).  I would like a full backup minus the excludes I threw in.

rsync -av / \\192.168.1.10\share\emailserver\ --exclude  "/share/" --exclude "/mnt/" --exclude "/proc/"

Thanks!
0
aiscom
Asked:
aiscom
  • 2
1 Solution
 
vancleefCommented:
The first question that comes to mind is; when running as root, can you look at the target directory?

# ls \\192.168.1.10\share\emailserver\

rsync needs to be able to see/write to the target directory for it to work and crontab processes are run as the owner of that process, normally root.  You can setup cron jobs for normal users, but that user would have to have access to all of the sendmail files and folders.


0
 
aiscomAuthor Commented:
There are no restrictions on that share on the NAS.  

If I do the above command though, it simply says "ls: \192.168.1.79shareemailserver: No such file or directory".
0
 
vancleefCommented:
Ahh... I missed it the first time around "\" is a shell escape flag and needs protection.

Notice the error "\192.168.1.79shareemailserver"

The \\ became \, because the first one protected the second.  The others protected the letters that followed them...  Two possible options, depending on how your system is setup.

1 - Use single quotes to protect the back slashes from the shell:
   '\\192.168.1.10\share\emailserver\'

2 - I suspect it is not really mounted on your system.  Run the mount command and see what file systems your box knows about. As I said, if you can't use ls to look at it, rsync can't write to it.

HOWTO: Mounting SMB/CIFS Shares
http://ubuntuforums.org/showthread.php?t=280473

0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now