How to use rsync to send files from your hard disk to a backup drive.
This example will copy the files from a folder to a backup drive and the ipinfo folder will be created on your backup HDD.
rsync -av Documents/ipinfo/ /media/jason/Seagate\ Expansion\ Drive/Linux/ipinfo/ sending incremental file list created directory /media/jason/Seagate Expansion Drive/Linux/ipinfo |
This is a great way to backup your files in a script. If I perform this operation again, the files are overwritten each time. Maybe use a date stamped folder easch time if you want to keep copies of the data for each backup.
Another way to copy files from one machine to another, this is using localhost, but it would also work on another host on your network.
scp jason@localhost:/home/jason/.bashrc /media/jason/Seagate\ Expansion\ Drive/Linux/ *************************************************************************** NOTICE TO USERS This computer system is the private property of its owner, whether individual, corporate or government. It is for authorized use only. Users (authorized or unauthorized) have no explicit or implicit expectation of privacy. Any or all uses of this system and all files on this system may be intercepted, monitored, recorded, copied, audited, inspected, and disclosed to your employer, to authorized site, government, and law enforcement personnel, as well as authorized officials of government agencies, both domestic and foreign. By using this system, the user consents to such interception, monitoring, recording, copying, auditing, inspection, and disclosure at the discretion of such personnel or officials. Unauthorized or improper use of this system may result in civil and criminal penalties and administrative or disciplinary action, as appropriate. By continuing to use this system you indicate your awareness of and consent to these terms and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the conditions stated in this warning. **************************************************************************** jason@localhost's password: .bashrc |
This is copying the .bashrc file from my main Linux computer to a backup drive.
Copy a folder across the network like this.
scp -r jason@localhost:~/Documents/ipinfo/ /media/jason/Seagate\ Expansion\ Drive/Linux/ |
This is recursive and goes into all sub-directories to get all files needed.
Another example.
scp -r jason@localhost:~/CoC /media/jason/Seagate\ Expansion\ Drive/Linux/ *************************************************************************** NOTICE TO USERS This computer system is the private property of its owner, whether individual, corporate or government. It is for authorized use only. Users (authorized or unauthorized) have no explicit or implicit expectation of privacy. Any or all uses of this system and all files on this system may be intercepted, monitored, recorded, copied, audited, inspected, and disclosed to your employer, to authorized site, government, and law enforcement personnel, as well as authorized officials of government agencies, both domestic and foreign. By using this system, the user consents to such interception, monitoring, recording, copying, auditing, inspection, and disclosure at the discretion of such personnel or officials. Unauthorized or improper use of this system may result in civil and criminal penalties and administrative or disciplinary action, as appropriate. By continuing to use this system you indicate your awareness of and consent to these terms and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the conditions stated in this warning. **************************************************************************** jason@localhost's password: 0018.png 100% 18KB 1.7MB/s 00:00 0005.png 100% 18KB 2.9MB/s 00:00 0008.png 100% 18KB 3.7MB/s 00:00 0019.png 100% 18KB 6.3MB/s 00:00 0016.png 100% 18KB 12.5MB/s 00:00 0020.png 100% 18KB 14.6MB/s 00:00 0009.png 100% 18KB 2.1MB/s 00:00 0014.png 100% 18KB 24.9MB/s 00:00 0001.png 100% 18KB 4.9MB/s 00:00 0002.png 100% 18KB 26.2MB/s 00:00 0013.png 100% 18KB 19.3MB/s 00:00 ClipGrab-3.8.4-x86_64.AppImage 100% 91MB 64.4MB/s 00:01 0003.png 100% 18KB 21.0MB/s 00:00 0006.png 100% 18KB 1.2MB/s 00:00 0017.png 100% 18KB 17.9MB/s 00:00 0012.png 100% 18KB 21.0MB/s 00:00 0015.png 100% 18KB 18.5MB/s 00:00 0007.png 100% 18KB 21.6MB/s 00:00 0004.png 100% 18KB 21.0MB/s 00:00 0010.png 100% 18KB 2.0MB/s 00:00 0011.png |
This shows the transfer speed of all transferred files, and the size of each file.
Yet another way to do this.
cp -R /home/jason/Documents/ipinfo/ /media/jason/Seagate\ Expansion\ Drive/Start_Here_Mac.app/ |
This is very fast.