How To Recursively Copy Remote Files in Linux

Sometimes, you may encounter copying deleted files in your Linux distribution. Several popular tools are used for this: scp and rsync. This article will describe specifically how each tool works.

Working with Scp

Scp is a special tool that can be used to securely copy files to and from a remote computer using the Secure Shell (SSH) protocol. Scp stands for Secure Copy. The basic syntax for the scp command is as follows:

scp <option> <source> <destination>

To copy files recursively, you need to use the -r option. For example, the command below will recursively copy the contents of the my / draft directory to the / backup directory on the remote server. A valid username on the remote server is required.

scp -r / draft redhat8@185.186.244.123:/backup

Here’s another example of recursively copying the contents of the /backup/draft directory from a remote server to a directory on my local machine

scp -r rredhat8@185.186.244.123:/backup/draught /recovered

Working with Rsync

The rsync tool, which stands for how remote synchronization is used to copy files between local or remote computers, and between computers on a network by comparing modification times and file sizes. It is commonly found on Unix-like operating systems. Rsync is written in C as a single threaded application. The basic syntax for the scp command is as follows:

rsync <options> <source <destination>

The ability to copy files recursively is denoted by -r. can synchronize Unix clients with a central Unix server using rsync / ssh and standard Unix accounts. It can be used in a desktop environment, for example, to efficiently synchronize files with a backup on an external hard drive. A scheduling utility such as cron can perform tasks such as automatic rsync encryption-based mirroring between multiple hosts and a central server. For example, the command below will recursively copy the contents of the my /draft directory to the /backup directory on the remote server. A valid username on the remote server is required.

rsync -rav /draught1.1 redhat8@185.186.244.123:/backup1.1

The following example recursively copies the contents of the /backup1.1/draught1.1 directory from the remote server to a directory on my local machine

rsync -rav redhat8@185.186.244.123:/backup1.1draught1.1 /recovered2

Was this article helpful?

Related Articles

2 Comments

  1. Доброго!
    Долго думал как поднять сайт и свои проекты и нарастить DR и узнал от крутых seo,
    крутых ребят, именно они разработали недорогой и главное продуктивный прогон Хрумером – https://www.bing.com/search?q=bullet+%D0%BF%D1%80%D0%BE%D0%B3%D0%BE%D0%BD
    Линкбилдинг сайт – ключ к SEO-успеху. Ссылки увеличивают доверие поисковых систем и позиции ресурса. Автоматизация через программы ускоряет процесс. Такой метод удобен для любых сайтов. Линкбилдинг сайт помогает достигать топовых позиций.
    этапы продвижение сео, правило лучших сео, Xrumer: практические примеры
    Массовый прогон сайта ссылками, заказать сео сайт москва, seo поддержка сайта это
    !!Удачи и роста в топах!!

Leave a Reply to norwich university hospital jobs Cancel Reply