command will copy increment data and keep it in sync with remote server.
- It will copy only incremental data.
- It will delete if any data deleted from source.
- It will copy again from source if any data deleted at destination.
- basically this command will keep the both environment in sync.
rsync -avWe ssh --delete-before (source) root@localhost:(destination)
rsync -avW --delete-before -e ssh (source) root@localhost:(destination)
Example:
rsync -avWe ssh --delete-before /data root@192.168.1.4:/data
rsync -avW --delete-before -e ssh /data root@192.168.1.4:/data
To delete files in the target, add the --delete
option to your command. For example:
rsync -avh source/ dest/ --delete
Recent Comments