Hello. I am working on creating a script to recursively run on my media collection. The goal is to recreate the folder structure, but with slight changes in the folder names based on my rules. The folders will also include the .jpg & .mkv files, renamed according to a similar set of rules.
Normally I would ask a portion of the script and piece the entire script together with my limited knowledge, however in this case I don't think that will come up with a very streamlined script at all. So, I'm going to explain my goal, and hope someone is willing to help me out!!
Here is my current directory structure:
Here is my desired directory structure using hardlinks to reference the .mkv & .jpg files:
So the goal is fairly straightforward - I want to recreate the directory structure of /cygwindrive/c/Media/ into /cygwindrive/c/Mediahardlinks/. Then I want to create hardlinks for all the .jpg & .mkv files in those directories, however I want to remove the " - ExtraTextNoSpaces12345" string within the .mkv & .mkv_sheet.jpg files in the hardlinks names. It should be noted that this text always appears after the 4 digit Year text in the filenames, will never have spaces, and is always the exact same within any given folder (since the .jpg file references the .mkv file). Also, the directory structure of /cygwindrive/c/Media/ includes other files in addition to the .jpg & .mkv files, however I am only interested in making the hardlinks to those types of files.
I would be extremely grateful is anyone would be willing to take the time to help me out with this script. Thanks in advance for the help!
Last edited by Davinator; 07-22-2012 at 03:37 PM..
Reason: Changed symlink to hardlink
You seem to be in Cygwin. Do symlinks even work there? That's not the same thing as a .lnk, you know.
Yeah, I've already confirmed they work in my setup. I tested using a simple ln command with no flags, and it works perfectly. I think the reason it works is because my end-device is linux-based.
Here's an example ln command I used when testing:
Last edited by Davinator; 07-22-2012 at 03:35 PM..
Reason: Added ln example
I know how to create a symlink but I am getting an error message that the file already exists. Also, my symlink doesn't point from target directory to the path correctly,
Here is an example of the path to my folder structure
path: cd /wkspce/wff/DEV/jobs/DEL
the folder structure is:
... (3 Replies)
I am trying to setup my plex server to use symlinks rather than host the movie files.
in my storage directory, i have both movies(some in subdirectory of the name and some just in the parent directory) and tvshows, which have subdirectories for each season, which contains the episodes
i would... (3 Replies)
Hello. I am hoping to have an automated way to create Playlist files from Genre txt files I'll be making with my music collection. This is for use with my WD Live player, and is so that certain albums / artists can live in multiple genre directories when I browse to them from my WD Live player.
... (4 Replies)
Hi Forums,
I got a little problem, I made a few modifications to the code of the launch script of a testing server(minecraft) and now updating is broken aswell as the automatic directory creation.
These Lines somehow create an endless symlink that refers to itself and I don't know how to fix... (0 Replies)
Hi Gems..
I am working out on project of creating a mass user on 100 server. Please help me with script where i can create an user id of new 80 user using shell script
Thanks in advance.
Indrajit Bhagat (1 Reply)
Hi there, i am completely new to this great forum and to linux. Since 3 days i work with Ubuntu Lucid Lynx and i love the powers of the shell.
This script helped me a lot to understand the process a little bit.
Now my problem. I have this data set, tab delimited:
... (4 Replies)
Hi guys i have written a script which takes the options given to him and execute itself accordingly.
for example
if a script name is doctortux then executing doctortux without option should made doctortux to be executed in automatic mode i.e. doctortux -a
or if a doctortux is needed to run in... (4 Replies)
Hi all,
I want to create a symlink on a link file, i mean, there is a file which is actually a symlink of some version. Now i want to create one more symlink on that link file.
EX: there is a file:
uat -> version
prod -> version
Now i want to create one more link on these 'uat' and... (1 Reply)
hi...
I have a folder<abc> under /root folder. I want to create a symlink such that when i click on folder<abc> under root, should display my home folder (home/krish).
Immediate inputs appreciated..... (1 Reply)