I suspect what you need to do would work like this.
- Stop unneeded running services
- Extract the tar to a temporary location
- Use rsync with the
-delete
option and proper excludes tosync from temporary location where you extracted your backup to the root of the filesystem.
- Reboot, since you will probably have running programs with deleted/replaced files still open.
How can I see which services are running and which are essential?
Since you effectively want to wipe everything out, the only services that are essential are the services you need to remotely access the system, and access any file systems. This probably includes SSH, and maybe other services. To see what is running, just use ps, top, pstree, or other tools like that.
And which exclusions do you consider as 'proper'?
It all depends on what you backed up, and what filesystems you want to over-write.
Obviously there would be no value over-writing any of the temporary filesystems like /tmp, /var/tmp, and so on. Basically that means you exclude anything mounted tmpfs these days.
You also would seriously make your system unhappy if you tried to sync over-write the /proc, or /sys filesystems.
So my definition of 'proper' is all the filesystems you have setup on your host. Since there is so much flexibility, you will need to figure out the right setup for your own system.
Could you give an example on how to use rsync with -delete option?
Not really, it would be something like rsync --dry-run --delete -av /source/ /destination/
.
I don't deal with VPSs much and I always have local control, and when I need to restore a system to an earlier state, I always boot off a livecd/pxe, which makes restoring a lot easier. Reverting to an earlier state from within a running system will take more exclusions. I don't know what you need for your system, you are probably best of building a test environment and playing around with it.