I want to switch from SME 8 on one machine to SME 9 on another machine. I've already installed SME 9 and some additional contribs etc. on the new machine, and now I'm preparing for transferring user files etc. also. I have daily backups with dar on the old machine.
In order to minimize the time to make the switch, my plan is to
- Make a full backup on the old machine (will take some time ...)
- Restore from this full backup on the new machine (will also take some time ...)
- Take the old machine off the network
- Make an incremental backup on the old machine (this should be quite small)
- Restore from this incremental backup on the new machine (should be quick)
- Test, and put the new machine in service
But I need to be sure that dar
- only spends time overwriting files on the new machine that have recently been changed on the old
- deletes files on the new machine that have recently been deleted on the old machine
I have done some tests with dar, and my experience is that dar always overwrites all files, and never deletes recently added files.
First, show contents of local directory "etc":
# find etc
etc
etc/imap
etc/imap/nyfil
etc/imap/fil1
Perform backup with dar
# dar -c mybackup -R ./etc
--------------------------------------------
3 inode(s) saved
including 0 hard link(s) treated
0 inode(s) changed at the moment of the backup and could not be saved properly
0 byte(s) have been wasted in the archive to resave changing files
0 inode(s) not saved (no inode/file change)
0 inode(s) failed to be saved (filesystem error)
0 inode(s) ignored (excluded by filters)
0 inode(s) recorded as deleted from reference backup
--------------------------------------------
Total number of inode(s) considered: 3
--------------------------------------------
EA saved for 0 inode(s)
--------------------------------------------
Copy a new file to etc/imap
# cp fil1 etc/imap/new_file
Try restore with dar
# dar -x mybackup -r -w -R ./etc
--------------------------------------------
2 inode(s) restored
including 0 hard link(s)
0 inode(s) not restored (not saved in archive)
1 inode(s) not restored (overwriting policy decision)
0 inode(s) ignored (excluded by filters)
0 inode(s) failed to restore (filesystem error)
0 inode(s) deleted
--------------------------------------------
Total number of inode(s) considered: 3
--------------------------------------------
EA restored for 0 inode(s)
--------------------------------------------
The added file is still there...
# find etc
etc
etc/imap
etc/imap/nyfil
etc/imap/fil1
etc/imap/new_file
And doing an additional restore seems to restore the files once more
# dar -x mybackup -r -w -R ./etc
--------------------------------------------
2 inode(s) restored
including 0 hard link(s)
0 inode(s) not restored (not saved in archive)
1 inode(s) not restored (overwriting policy decision)
0 inode(s) ignored (excluded by filters)
0 inode(s) failed to restore (filesystem error)
0 inode(s) deleted
--------------------------------------------
Total number of inode(s) considered: 3
--------------------------------------------
EA restored for 0 inode(s)
--------------------------------------------
Dar has so many options, it's quite confusing to me .. Maybe someone here can help?