# Backup with rsync - Permission Issues (fixed)

## Bigun

I'm backing up a 3 Tb array onto a single external drive for offsite backup, and I'm using rsync to accomplish this and running the command with root, and I'm running into some permission issues.  Here's a sampling:

```
rsync: send_files failed to open "/mnt/external_storage/Backup/Server/Wed/etc/ssh/ssh_host_ecdsa_key": Permission denied (13)

rsync: send_files failed to open "/mnt/external_storage/Backup/Server/Wed/etc/ssh/ssh_host_rsa_key": Permission denied (13)

rsync: send_files failed to open "/mnt/external_storage/Backup/Server/Wed/etc/ssh/sshd_config": Permission denied (13)

rsync: send_files failed to open "/mnt/external_storage/Backup/Server/Wed/etc/ssl/apache2/server.key": Permission denied (13)

rsync: send_files failed to open "/mnt/external_storage/Backup/Server/Wed/etc/ssl/apache2/server.pem": Permission denied (13)

```

Etc.

The "/mnt/external_storage" is the source, the destination is "/mnt/backupdrive", here is the command I'm using to backup.

```
rsync -va --progress /mnt/external_storage/ /mnt/backupdrive/
```

The majority of files backed up, there are just a select few that aren't, here are the permissions on one of these files:

```
ls -la /mnt/external_storage/Backup/Server/Wed/etc/ssl/apache2/server.pem

-r-------- 1 someuser users 1930 Jan 25  2012 /mnt/external_storage/Backup/Server/Wed/etc/ssl/apache2/server.pem
```

Running the command as root I *thought* would access all files, was I mistaken?

----------

## gentoo_ram

What kind of mount is /mnt/external_storage?

Is it a locally connected disk?  If so, what filesystem is it using?

Is it network storage?  If so, what protocol is it using?

The answer will give us clues as to why root can't access the directory.

----------

## Bigun

 *gentoo_ram wrote:*   

> What kind of mount is /mnt/external_storage?

 

Here is the entry in /etc/fstab:

```
/dev/sdf1               /mnt/backupdrive        xfs     noauto,rw       0 0
```

 *gentoo_ram wrote:*   

> Is it a locally connected disk?  If so, what filesystem is it using?

 

Yes, it is a USB connected disk, and I have it formatted in the XFS filesystem.

 *gentoo_ram wrote:*   

> Is it network storage?  If so, what protocol is it using?

 

Nope.

----------

## Odward

 *Bigun wrote:*   

>  *gentoo_ram wrote:*   What kind of mount is /mnt/external_storage? 
> 
> Here is the entry in /etc/fstab:
> 
> ```
> ...

 

Not sure I can be of any help, but you may have provided answers regarding (DEST) /mnt/backupdrive and not (SRC) /mnt/external_storage

where the permission issue appears to be occurring.

----------

## Bigun

 *Odward wrote:*   

>  *Bigun wrote:*    *gentoo_ram wrote:*   What kind of mount is /mnt/external_storage? 
> 
> Here is the entry in /etc/fstab:
> 
> ```
> ...

 

 :Embarassed: 

Crap, you are right:

```
//127.0.0.1/Media /mnt/external_storage cifs pass=test,user=bigun,uid=bigun,gid=users,rw,auto 0 0
```

You'll have to forgive me, my wife went into pre-term labor and I'm trying to deal with a lot at the moment, excuse the brief idiocy.

This also may have revealed why it wasn't working.  Very long story, but the actual RAID is mounted here:

```
/dev/md125              /mnt/media      xfs             auto,rw         0 0
```

The reason for the CIFS mount is because I have a SAMBA share setup for use by several devices on the network, and if files written by the server (by programs like rtorrent) aren't done through the CIFS protocol, they won't be able to be read by other machines on the network through the SAMBA share.

That said, I erased all the data on the backup drive and am now trying to sync through "/mnt/media" to see if that has better luck.

I wish my wife would have this baby already so I would quit making these mistakes.

----------

## Bigun

Yup, the very reason I setup CIFS and tried to do all transactions through was what I was encountering.  Luckily I don't need to access apache configuration files through WDTV live or anything like that, so I just switched mounting points and it appeared to work just fine.  Just to double check, I ran it again, and no errors:

```
rsync -va --progress /mnt/media/Media/ /mnt/backupdrive/

sending incremental file list

sent 6393292 bytes  received 112533 bytes  57829.56 bytes/sec

total size is 1862322738228  speedup is 286254.66

```

----------

