Skip to main content

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Asked
Modified 1 month ago
Viewed 39 times
0

I'm trying to use rsync to copy data from a webserver to a local backup. Considering I need to copy several things, including some home directories from different users, I'm running rsyncd with a few predefined modules.

  • [homedirs] with path /home and includes/excludes set up to not copy e.g. cache files
  • [database] with the path set to where I make SQL dumps
  • [server] with the path set to where the server configuration lives

I'm currently running three separate commands in the form of rsync -az $HOST::$MODULE ./$MODULE whenever I create a backup. I've tried rsync -az $HOST::$MODULE1 ::$MODULE2 ::$MODULE3 ./, but this results in the contents of those modules being dumped in the same place, instead of in separate directories.
I wouldn't mind the directories where the backups end up in to have the same name as the server-side dirs (e.g. /path/to/backups/home), or to have arbitrary other names, so long as the files are consistently split into a different directory for every module offered through rsyncd.

0

1 Answer 1

2

I don't think you can do what you want in one command. The best I can think of right now is three parallel transfers:

for module in homedirs database server
do
    rsync -az "$rHost::$module/" "$module" &
done
wait

But this is essentially already what you have.

You mentioned you're transferring from a remote server. You might want to consider some sort of encryption tunnel (SSH or VPN) as the rsyncd protocol isn't encrypted and data is transmitted in the clear

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.