# `rsync`
- `rsync`
- Local Backup:
- `rsync -avh *.tar backup_path`
- can specified multiple input files
- common options: -a option archives the input files, -v for verbose, -h for human readable output, -P for progress
- -a option is equivalent to -rlptgoD
- -r for recursive
- -l copies links and symlinks
- -p preserves perms
- -t preserves mod times
- -g preserves group
- -o preserves owner
- -D preserves special files, character device files, and block device files
- can specified multiple input files
- Remote Backup:
- `rsync -avP -e ssh *.tar user@destination_ip_address:output_path`
# `SCP`
- `scp` secure copy that uses ssh
- functions like `cp` over a network
- Push file local to remote location
- `scp source_file user@remote_dest_ip:dest_path` copies file from local source to remote dest over the network
- Fetch file from remote location
- `scp user@remote_host_ip:source_path dest_path` copies file from remote source to local dest over the network
# `SFTP`
- `sftp` ftp that uses ssh
- interactive session to remote file server using ssh
- `sftp remote_host_ip` creates a secure session with the ftp server
- `connected to remote host \n sftp>`
- use `get file_name` to download file from remote_host to local dest
- use `put file_name` to upload file from local source to remote_host
- `ls` to list files on remote system
- `lls` to list files on local system
- `bye` or`exit` to terminate connection
# `nc` & `dd`
- Combination of `nc` and `dd`
- Destination Machine:
- `nc -l -p 12345 | dd of=/path/to/destination/backup.img` to open a listener on port 12345 and specify output file path
- Source Machine:
- `dd if=/dev/sda | nc destination_ip_address 12345` specifies input file path and the ip + port on the listener