0

my company uses 1 NAS Synology Diskstation with RAID 1 working perfect. We only use ubuntu and I do external backups with rsync (like Synology Documentacion recommends) ,its the easiest way.

I mount the directory of shared files (NFS) that I wanna copy and proceed with the rsync like this generic example

 rsync -avhr /src /dest --info=progress2 --log-file=log.txt

Rsync shows progress of the files copying (NFS to EXT4), the logs are good and when I compare my local directory with the NAS directory looks like everything is perfect.

We need to verify that everything is good so I have a little script like this one displaying the number of files inside the directory (recursively) and the total size of it.

#!/bin/bash
number=`find . -type f -ls | wc -l`
size=`du -sh | cut -d " " -f 1`
echo "Number of files = $number"
echo "Size of directory = $size"

I expect the result of the script in the rsync source to coincide with the rsync destiny but that just doesn't happen.

Source values: 
Number of files = 10073211
Size of directory = 120 G

Destiny values:
Number of files = 10073209
Size of directory = 592 G

So I dont understand it, rsync clearly made something wrong at the backup but I can't say what it is, destiny misses 2 files but its nearly 500 GB bigger than the source? how can that happen? Rsync log doesn't show nothing wrong.

The problem is that I have very limited access to the NAS cause when I do backups (or something that stress it),the rest of people in the company cant use the intranet and the needed data from there.

I will have to repeat the rsync (made my mind) but want to be completely secure that nothing 'll fail before do it.

I'm trying to reserve the dry-run like last option cause affects to the intranet too

As usual, sorry for my english (I tried) and thank you for the answers

Antonio.P
  • 21
  • 1
  • is it possible symlinks cause you grief? What does this say? diff --brief -Nr dir1/ dir2/ – Mattias Åslund Jun 14 '16 at 07:48
  • There is no symlinks on that directory so can't be that but thank you for the idea. Anyway I will try it next time if I can't fix it sooner. My guess its sparse files issue. Now I'm waiting to look cause coworkers are giving intensive use to the NAS. – Antonio.P Jun 14 '16 at 09:26

0 Answers0