Incremental backup and empty dirs

rsync at renton.name rsync at renton.name
Tue May 1 19:33:09 GMT 2007


On Mon, Apr 30, 2007 at 07:17:52PM +0400, Mark wrote:
> Hi,
> 
> I use rsync with such options:
> 
> OPTIONS="-a -u -z -v -S --delete-during --ignore-errors \
>          -b --backup-dir=${PATH_BACKUP}/${DATE_YESTERDAY} \
>          --exclude-from=$IGNORE"
[skip] 
> 
> Do you know what to do it to make empty dirs be transferred
> to ${PATH_BACKUP}/${DATE_YESTERDAY}?

All the written above in actual work:

# ls -l
total 0
drwxr-xr-x 2 root root  48 May  1 23:07 backup
drwxr-xr-x 5 root root 192 May  1 23:08 test

# ls -l test/
total 0
drwxr-xr-x 2 root root 48 May  1 23:08 dir1
drwxr-xr-x 2 root root 48 May  1 23:08 dir2
drwxr-xr-x 2 root root 48 May  1 23:08 dir3
-rw-r--r-- 1 root root  0 May  1 23:08 file1
-rw-r--r-- 1 root root  0 May  1 23:08 file2
-rw-r--r-- 1 root root  0 May  1 23:08 file3

# ls -l backup/
total 0

# rsync -a -z -v -S --delete-during -b --backup-dir=/full_path_to/backup/`date -d '1
day ago' +%Y-%m-%d` ./test/ ./backup/current
building file list ... done
created directory ./backup/current
./
file1
file2
file3
dir1/
dir2/
dir3/

sent 266 bytes  received 110 bytes  752.00 bytes/sec
total size is 0  speedup is 0.00

# ls -l backup/current/
total 0
drwxr-xr-x 2 root root 48 May  1 23:08 dir1
drwxr-xr-x 2 root root 48 May  1 23:08 dir2
drwxr-xr-x 2 root root 48 May  1 23:08 dir3
-rw-r--r-- 1 root root  0 May  1 23:16 file1
-rw-r--r-- 1 root root  0 May  1 23:08 file2
-rw-r--r-- 1 root root  0 May  1 23:08 file3

# rm test/file1

# rsync -a -z -v -S --delete-during -b --backup-dir=/full_path_to/backup/`date -d '1
day ago' +%Y-%m-%d` ./test/ ./backup/current
building file list ... done
./
deleting file1

sent 119 bytes  received 26 bytes  290.00 bytes/sec
total size is 0  speedup is 0.00

# ls -l backup/current/
total 0
drwxr-xr-x 2 root root 48 May  1 23:08 dir1
drwxr-xr-x 2 root root 48 May  1 23:08 dir2
drwxr-xr-x 2 root root 48 May  1 23:08 dir3
-rw-r--r-- 1 root root  0 May  1 23:08 file2
-rw-r--r-- 1 root root  0 May  1 23:08 file3

# ls -l backup/2007-04-30/
total 0
-rw-r--r-- 1 root root 0 May  1 23:18 file1

# rmdir test/dir1

# rsync -a -z -v -S --delete-during -b
--backup-dir=/full_path_to/backup/`date -d '1 day ago'
+%Y-%m-%d` ./test/ ./backup/current
building file list ... done
./
deleting dir1/

sent 107 bytes  received 26 bytes  266.00 bytes/sec
total size is 0  speedup is 0.00

# ls -l test/
total 0
drwxr-xr-x 2 root root 48 May  1 23:08 dir2
drwxr-xr-x 2 root root 48 May  1 23:08 dir3
-rw-r--r-- 1 root root  0 May  1 23:08 file2
-rw-r--r-- 1 root root  0 May  1 23:08 file3

# ls -l backup/current/
total 0
drwxr-xr-x 2 root root 48 May  1 23:08 dir2
drwxr-xr-x 2 root root 48 May  1 23:08 dir3
-rw-r--r-- 1 root root  0 May  1 23:08 file2
-rw-r--r-- 1 root root  0 May  1 23:08 file3

# ls -l backup/2007-04-30/
total 0
-rw-r--r-- 1 root root 0 May  1 23:18 file1

In result the catalog "dir1" is lost.
Why?

-- 
BRGDS. Mark.


More information about the rsync mailing list