Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This 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.


  Search this Thread
Old 07-12-2014, 12:48 PM   #1
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
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.
Old 07-12-2014, 01:11 PM   #2
Registered: Dec 2010
Posts: 281

Rep: Reputation: 24
it appears rsync is without any way to simply make empty 'copies' of a directory of files..

seems you will have to homebrew a method

Last edited by cin_; 07-12-2014 at 01:11 PM. Reason: gramm`err
Old 07-12-2014, 04:05 PM   #3
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Original Poster
Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357

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!

Last edited by haertig; 07-12-2014 at 04:08 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare two folders(recursively) for file names and file contents alaios Linux - Software 9 10-28-2017 04:20 AM
File contents copy rk_monde Linux - Newbie 2 03-15-2011 09:43 AM
Copy the contents of a txt file to other txt files (with similar names) by cp command Aquarius_Girl Linux - Newbie 7 07-03-2010 12:54 AM
Make a Script Fle that opens A file and prints its contents (processes names) once jianelisj Linux - Newbie 4 03-17-2008 12:27 PM
my cd contents file names not displaying morethan 8 digits. AMajeed AIX 5 08-08-2007 09:56 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:39 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration