rsync – we synchronize files from the computer to the server

How to transfer (synchronize) files from a directory on a Mac OS computer to a remote server via bash script.

To transfer files with synchronization, the following command is suitable:

rsync -avz ~/Sites/ * root@

Note that there is a colon after the IP address.

You can also delete files beforehand DS_Store:

find ~ / Sites / / files -name ‘* .DS_Store’ -print0 -delete

Or transfer file extensions by mask * .txt as in the command below.

To transfer without synchronization, you can use the command scp:

scp -r ~/Sites/ *.txt ssh root@

^ I don’t remember exactly, but it seems like it’s possible without the word ssh.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *