0

I try to make backup-system. I try to use rsnapshot.

description:
Client with rsnapshot put data in sshfs-mounted folder (sftp backup-server). I make ssh-key, mounted it, everything fine.

In rsnapshot conf I enabled link_dest=1, because defaults 0 made rsnapshot cry about hard links on ssh mounted folder.

error description:
I made rsnapshot autostart using cron. After couple of days I checked my folders I saw that they a small size. (all data is 4gb, but folders are around 300mb,400mb).

I checked copying to ssh folder. cp data ssh_folder. Everything go ok and not so slow: about 30 min and I saw my 4gb on ssh folder.

OK.I started rsnapshot manually with files verbose.

rsnapshot -V hourly

The only errors is chown error (it's not so easy with ssh) Also nothing in log files. It's just freeze on some file.

It's the first strange think. And the second is that: I try to make incremental backup trying to minimize time syncing to ssh. But when I check my new hourly directory I just see part of my data, not new data or links to old_data. just the same files in new folder.

Very big huge full of thankfull thanks to any advices.

UPD: there is no big files. it's a web server

UPD: using strace

select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)
select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)
select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)
select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)
select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)
select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)
select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)
select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)
select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)
select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)
select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)
select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)
select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)
select(5, [], [4], [], {tv_sec=60, tv_usec=0}) = 0 (Timeout)

UPD: I think that I found solution. My backup-folder was inside my home folder, which I try to backup. After I excluded it, everything seems to be fine, but no. 0 (Timeout) came much later. strace from other (receiving side):

--- SIGSTOP {si_signo=SIGSTOP, si_code=SI_USER, si_pid=124744, si_uid=0} ---
--- stopped by SIGSTOP ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGSTOP {si_signo=SIGSTOP, si_code=SI_USER, si_pid=124744, si_uid=0} ---
--- stopped by SIGSTOP ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGSTOP {si_signo=SIGSTOP, si_code=SI_USER, si_pid=124744, si_uid=0} ---
--- stopped by SIGSTOP ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGSTOP {si_signo=SIGSTOP, si_code=SI_USER, si_pid=124744, si_uid=0} ---
--- stopped by SIGSTOP ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGSTOP {si_signo=SIGSTOP, si_code=SI_USER, si_pid=124744, si_uid=0} ---
--- stopped by SIGSTOP ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=124744, si_uid=0} ---
select(5, [3], [], NULL, NULL)          = ? ERESTARTNOHAND (To be restarted if no handler)
mr.frog
  • 129
  • 6

2 Answers2

2

Do not use sshfs, as its stability is not always top-notch and it's behavior with rsync can be sub-optimal.

Rather, configure rsnapshot to directly use rsync-over-ssh. An example from rsnapshot man page:

backup root@foo.com:/etc/ foo.com/

Give a look to rsync man page also for more information.

shodanshok
  • 47,711
  • 7
  • 111
  • 180
-1

I think that I found solution. There was 2 errors.
First - My backup folder was in sync folder. (I mounted backup-server in /home/backup, but sync the whole /home).
So rsync always give timeout (0) trying to make this strange recursive task.

Second problem was connection. After some time of syncing began some desynchronization between server and client (provider limits I think, not connection problem cause it was mounted properly). And this also lead to timeout (0).
If only I have the second error - it wasn't problem at all, because couple of rsync starts and folder will be on server. But because I had First error, rsync can't continue to sync and started again and again.

mr.frog
  • 129
  • 6