Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Linux Command Line and Shell Scripting Techniques

You're reading from   Linux Command Line and Shell Scripting Techniques Master practical aspects of the Linux command line and then use it as a part of the shell scripting process

Arrow left icon
Product type Paperback
Published in Mar 2022
Publisher Packt
ISBN-13 9781800205192
Length 552 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Jasmin Redzepagic Jasmin Redzepagic
Author Profile Icon Jasmin Redzepagic
Jasmin Redzepagic
Vedran Dakic Vedran Dakic
Author Profile Icon Vedran Dakic
Vedran Dakic
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Chapter 1: Basics of Shell and Text Terminal 2. Chapter 2: Using Text Editors FREE CHAPTER 3. Chapter 3: Using Commands and Services for Process Management 4. Chapter 4: Using Shell to Configure and Troubleshoot a Network 5. Chapter 5: Using Commands for File, Directory, and Service Management 6. Chapter 6: Shell-Based Software Management 7. Chapter 7: Network-Based File Synchronization 8. Chapter 8: Using the Command Line to Find, Extract, and Manipulate Text Content 9. Chapter 9: An Introduction to Shell Scripting 10. Chapter 10: Using Loops 11. Chapter 11: Working with Variables 12. Chapter 12: Using Arguments and Functions 13. Chapter 13: Using Arrays 14. Chapter 14: Interacting with Shell Scripts 15. Chapter 15: Troubleshooting Shell Scripts 16. Chapter 16: Shell Script Examples for Server Management, Network Configuration, and Backups 17. Chapter 17: Advanced Shell Script Examples 18. Other Books You May Enjoy

Learning how to use rsync

In our previous recipe, we worked with SSH from the client standpoint. We used SSH and SCP to both log in and copy files from source to destination. We discussed how to use a username/password combination to log in to a remote system, as well as how to use SSH key-based authentication. If we focus on SCP for a second, there's one thing that we didn't discuss, and that is how to synchronize the local source to the local destination, or, even better, how to create a scenario in which we synchronize the local source to a remote destination and vice versa between two Linux servers in place. This is where it's best to use rsync, a tool that's meant to do just that. Let's get cracking.

Getting ready

We will continue using our cli1 and cli2 machines, running Ubuntu and CentOS. Let's get ready by making sure that the necessary packages are installed. We need to use this command for Ubuntu:

apt -y install rsync

We use the following...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image