How to Rsync Consecutive Files in Linux

Rsync is a useful and easy to use command line backup tool in Linux. It has a large number of options designed to give users maximum control over the backup process and is an excellent tool for use with backup shell scripts or scheduled cron jobs. Backing up consecutive files is easy, thanks to the Linux shell's support for wildcards and bracket expressions that can be passed directly to rsync.

Things You'll Need

  • rsync


    • 1

      Open a terminal window so you can work from the command line.

    • 2

      Use wildcards or patterns to build your list of consecutive files. For instance, if you want to backup a list of jpg files that begin with "file," you could use "file.jpg." Linux would replace the "" with anything, just as long as everything else matches. If your files are numerically consecutive, you could use something like "file_[0-9].jpg" to get everything from "file_0.jpg" to "file9.jpg." Changing that to "file[0-9]*.jpg" would include things like "file_10.jpg" and "file_0506a.jpg."

    • 3

      Type "rsync -ahv <consecutive file range> <destination directory>" and press enter. The "-a" option instructs rsync to use the "archive" options, which recurses directories, and preserves things like file datetimes, owner amd permissions. The "-h" option makes things a bit more human-readable, and "-v" makes everything verbose, so you can see what's going on. If you want to see what would happen without actually starting the backup, use the "--dry-run" option.

Related Searches



You May Also Like

  • How to Install & Play Il-2 Sturmovik in Linux

    "Il-2 Sturmovik" is one of the most iconic flight simulators in the genre. Launched in 2001, it has been systematically upgraded by...

  • How to Use Rsync for Backups

    Rsync is a free utility for copying sets of files. It supports automatic compression, authentication and transparent network connections. The rsync protocol...

Related Ads

Check It Out

Geek Vs Geek: We Fly Drones, Accidents Ensue