From the course: Learning Rsync

Unlock the full course today

Join today to access over 25,200 courses taught by industry experts.

Automating rsync jobs

Automating rsync jobs - rsync Tutorial

From the course: Learning Rsync

Automating rsync jobs

- [Instructor] So far, we've been typing out rsync commands manually at the command line, and while we might use this strategy for individual copy jobs, it's not very efficient if we need to have the same job run over and over again. There's two steps we can take to address this. To begin, we can wrap our rsync command in a script so that all we have to do is run the script instead of typing or pasting along an, potentially error prone, command. For example, I'll create a script file here. And I'll add a fairly basic command to back up a home folder. I've split it across many lines with line continuation characters so it's easier to read, and notice I'm using the -e option to point SSH to my private key in my user home directory. Without a key, I'd need to type my SSH password in each time this runs. Also notice that I'm excluding a few directories that I don't need to back up. It's important here to use absolute paths…

Contents