Clearcase Relocation command - clearcase

I'm relocating certain files to a new VOB in ClearCase.
example:
VOB1/folder1/folder2/file1
to
VOB2/folder1/folder2/
folder1 and folder2 in VOB2 are newly created folders.
I cannot see the labels of folder1 and folder2 applied in VOB1 in VOB2.
Is there any way the labels can be copied to folder1 and folder2 in VOB2 from VOB1?

Relocating files (mentioned in your previous question) means the relocation will involves only data and metadata attached to that file, not to its parent folder.
When you relocate a file element, you relocate all of the element's data and metadata.
Any label attached to the parent folder won't be relocated in that process.
I have created a new folder and sub-folders in the destination VOB with the same name as source VOB
You actually can try to move folder1/folder2/file1 without creating folder1/folder2 first in the destination vob, and see if folder1/folder2 are created then, with their associated label.
If that doesn't work, and your relocation is for files only, it is best to apply the label manually (mklabel) for their parent folders.
See "Need script/utility to label MOST, if not all, ClearCase elements for a given path".

Related

Oneliner for SVN adding files inside unversioned subfolders

I have files that i want to add to svn that are inside a number of nested sub folders. All the subfolder tree is still unversioned.
Say i want to version file1 and file2 (but not file 3) inside subsubfolder and no other file inside subfolder (i.e. file0).
The current filesystem is as follows
trunk
|--subfolder
|--file0
|--subsubfolder
|--file1
|--file2
|--file3
Trunk is versioned, subfolder and subsubfolder are not versioned.
svn add /subfolder/subsubfolder/file1
gives
svn: warning: W155010: The node 'trunk/subfolder/subsubfolder' was not found.
svn: E200009: Could not add all targets because some targets don't exist
svn: E200009: Illegal target for the requested operation
I wonder if there is a quick, potentially one-liner, command to add those files instead of going through adding all the subfolders along the way (without adding their content) and then finally adding the files.
Use the --parents option. Here is an example:
svn add --parents /subfolder/subsubfolder/file1

Loop through a directory in Talend

I have a Directory with many sub-directories in it including one named as OLD. This OLD folder could also be inside any of the sub directories and contains archived files.
Root Directory A
SUB-DIRECTORY A
file1.txt
file2.txt
SUB-DIRECTORY B
file1.txt
file2.txt
OLD
SUB-DIRECTORY C
file1.txt
file2.txt
SUB-DIRECTORY D
file1.txt
OLD
SUB-SUB-DIRECTORY E
file7.txt
OLD
I need to create a job in Talend which shall look for all OLD folders (in main and in sub directory both) and delete the files from that folder. I can use tFilelist to and mask the files to be deleted. But unable to figure out how to configure the job to look for OLD folder in all sub directories and delete those files also.
What you need to do is in the tFileList put your main folder choose check box include sub directories and in the FileList type drop down list choose Directories. Your file mask should be "OLD" or if it is anything more "OLD".
Iterate and use the parameter ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
to capture your sub directories. Now you can use this folder path in a tFileDelete Which can also delete folders
follow below approach..
Add tFileList and configure to Travers over all the directories.
now use if conndition connection from tFileList
Add tJava and connect with iterator connection
Add tFileDelete after tJava and connect with IF condition.
Add below condition inside if condition.
((String)globalMap.get("tFileList_2_CURRENT_FILEPATH")).contains("OLD")
Now you will get the all files from all the directories above code will give pass to the files which has the "OLD" in there file path.
I have not tested but you can try it.

How to move subdirectories including files from directory

On a shared drive there is a directory "Q:\batch_Rxaoutput" inside that directory there are over a thousand directories for example "Q:\batch_Rxaoutput\SUNY" or "Q:\batch_Rxaoutput\PDFL". The subdirectory within "Q:\batch_Rxaoutput" contains only four letter codes where monthly reports are outputted by an SSIS package. Sometimes a report needs to re-ran due to errors so there are multiple reports created within one of the thousand or so output locations. My goal is to loop through each folder insided "Q:\batch_Rxaoutput" and move the folders, subfolders and files contain the same name.
For example in Q:\Batch_Rxaoutput\EEKY there is:
Q:\Batch_Rxaoutput\EEKY\Dec2014_20150108044150
Q:\Batch_Rxaoutput\EEKY\Dec2014_20150114090454
Q:\Batch_Rxaoutput\EEKY\Dec2014_20150115094531
Q:\Batch_Rxaoutput\EEKY\Feb2015_20150302122307
Q:\Batch_Rxaoutput\EEKY\Jan2015_20150202214348
Q:\Batch_Rxaoutput\EEKY\Jan2015_20150214223734
I want to to move only the no current folders,subfolders and files.
the monthly folder names are Month.year_year.month.hours(military).hours.seconds.milliseconds
So basically if there are multiple folder names Feb2015_* or Jan2015* move the ones that have the lowest numeric value after the underscore.
I would love to accomplish this from a .bat cmd if possible.
Please let me know if there is more info that would help!

In AppleScript, how do I copy a directory's contents to another directory without deleting the destination directory's existing files?

I'm trying to copy files and directories from one directory called "Motion Templates" to another directory called "Motion Templates".
tell application "Finder"
set srcPath to ((parent of (path to me) as text) & "Motion Templates")
set dstPath to (((path to movies folder) as text) & "Motion Templates")
set srcFolder to folder srcPath
set dstFolder to folder dstPath
duplicate entire contents of srcFolder to dstFolder with replacing
end tell
The source directory (Motion Templates) contains a subdirectory (Generators) which successfully copies over to the destination "Motion Templates" in terms of matching file paths (from a source "Motion Templates/Generators" to a destination "Motion Templates/Generators"). However, this script also deletes all of the existing subdirectories that existed in "Motion Templates/Generators". How do I go about copying/overwriting files without deleting the other existing files in the tree?
This is far to confusing to explain when you are using the same names. It's like trying to understand Who's on first for the first time. Try using different folder names until you can get it working then worry about what things are called.
To try and help the only thing I can say is if the files have the same exact names and you use the "with replacing" it will overwrite what ever is in the destination folder. If you are saying the source folder is being deleted then you are having an issue where the files are being moved and not duplicated.

Need to copy and rename files in different folders

would anyone know how to write a batch file (or two) that would:
copy hundreds of "index.html" files that are in different folders and keep within the same folder (so needs to search within sub folders)
rename the copies (keep the originals as is) to "index.jpg"
could anyone help?
I used a bulk rename tool to rename all index.html files to index.jpg in a copy of the main folder, then used robocopy to copy everything over, including the file structure back to the original folder (leaving the index.html's alone)

Resources