Hundreds of command line utilities are still used despite graphical user interfaces dominating modern operating systems. However, as useful as they are, they’re not nearly as easy to use as their graphical counterparts, meaning you’re bound to run into a few problems sometimes.
In this article, we’re talking about Rsync skipping directories, the reasons behind it and what you can do to fix the problem.
What causes Rsync to skip directories?
Generally, Rsync tends to skip active directories during transfers or syncs. If you transfer any files during synchronisation, the tool might skip them to prevent redundant or corrupt files from populating your server.
Other common causes include:
- Server connectivity issues
- Invalid command syntax
Also read: How to fix ‘Task error: command apt-get update failed: exit code 100’?
How to fix Rsync skipping directories?
Here are two fixes you can try out.
Lack of the recursive mode flag
As with all command line tools that deal with multiple files, it’s important to tell the Rsync command to go through files recursively. Not doing so can cause it to skip important files instead.
You can do this by adding the -a flag to your existing command. The command tells the Rsync tool to reproduce file hierarchies, including any special files and permissions that you might need to be copied to your server. Your command should look something like this.
rsync -a ./export/ myuser@123.456.789.000:/server/oath
Using Symlinks
Rsync skips symlinks by default, as they can cause security issues when used on a server. If you want symlinks to be copied to your server regardless, you can use the -l flag to tell Rsync to include symlinks in the transfer. Here’s what your command will look like.
rsync -l ./export/ myuser@123.456.789.000:/server/oath
Also read: Fix: Error adding symbols: DSO missing from the command line