I am doing backups of a directory with a simple:
cp -R /production/directory /backups/location
Sometimes I need to restore a backup, but doing:
cp -R /backups/location/* /production/directory
cp -RT /backups/location /production/directory
has the unwanted (in my case) effect, of keeping files present in
but not in the backup, while I want them removed, to get things in the exact same state as when the backup was done.
Is there any magic switch, or other simple command, to perform that, or do I need to manually remove the whole directory first ?