如何使用root权限备份备份远程文件,并且没有root ssh登录?

时间:2013-07-29 07:30:55

标签: rsync

好吧,我目前使用lbackup来备份远程服务器上的文件。所以我使用我的帐户登录,这不是root。

我得到了以下错误,显然,我的帐户不是www-data。

有什么建议吗?

$ ls -l / var / www / cache | grep cache drwx ------ 13 www-data www-data 4096 Jul 28 06:27 cache

Sun Jul 28 23:53:17 CST 2013

Hard Links Enabled
Synchronizing...
Creating Links
rsync: opendir "/var/www/bbs/cache" failed: Permission denied (13)
IO error encountered -- skipping file deletion
rsync: opendir "/var/www/bbs/files" failed: Permission denied (13)
rsync: opendir "/var/www/bbs/store" failed: Permission denied (13)
rsync: send_files failed to open "/var/www/bbs/config.php": Permission denied (13)

Number of files: 10048
Number of files transferred: 1919
Total file size: 202516431 bytes
Total transferred file size: 16200288 bytes
Literal data: 16200288 bytes
Matched data: 0 bytes
File list size: 242097
File list generation time: 0.002 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 39231
Total bytes received: 5617302

sent 39231 bytes  received 5617302 bytes  50731.24 bytes/sec
total size is 202516431  speedup is 35.80
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at      main.c(1536) [generator=3.0.9]

WARNING! : Data Transfer Interrupted

WARNING! : No mail configuration partner specified.
           To specify a mail partner configuration file add the
           following line into your backup configuration file :

           mailconfigpartner=nameofyourmailpartner.conf

1 个答案:

答案 0 :(得分:0)

你有两种可能性:

a)忽略您无法阅读的文件(--exclude=PATTERN

b)获取这些文件的读取持久性,可以通过以其他用户身份登录,也可以通过chmod来获取文件,无论适当的是什么