[SOLVED] HowTo? Make rsync copy file names but not contents
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
HowTo? Make rsync copy file names but not contents
Is there a way to do this? I have a few directory structures where the filenames ARE the data (the files themselves only contain a few worthless bytes). I could write some custom commands to do this backup, but I was wondering if rsync can be told/tricked into doing this for me, since I already use rsync for all my other backups.
In case anyone is wondering what strange application I have that might need something like this, it is related to how I am using Plex Media Server. Plex manages all my video collection, including all the DVD's I own. The DVDs are not stored on my computer with the other videos, but I create filenames for them just as if they were, and Plex will then catalog them, load metadata and artwork from the internet, etc. Plex will not catalog a zero length file, so I put the bogus text "DVD" inside the files to trigger Plex to process them. And I name the files with an mp4 extension to kick Plex into cataloging them too. These DVD files are obviously small, and backing up their contents would not be a problem, except they are intermixed with other regular video files (of considerable size) that I do not want to back up.
I went the easy route. Instead of writing a custom script, what I did was move all the placeholder DVD files to their own separate directory. And had rsync skip the main video file directory (that contains large video files), but include the DVD file directory (that has the small 4-byte long DVD-named files). Worked fine. Then I just configured Plex to recognize both the main video file directory AND the DVD directory as the "Movies library". Problem solved!
Apparently rsync can't do what I was proposing. The question of having rsync copy filenames but not contents was not solved, but my underlying goal of accomplishing the backup task at had was solved. Hence, I'm marking this thread as solved anyway. Thanks!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.