Sponsored Content
Top Forums Shell Programming and Scripting Move directory recursive and leave symlinks at source Post 303009418 by carnagel on Thursday 14th of December 2017 08:04:55 AM
Old 12-14-2017
Only read activity - no changes or writes being made to files, or new files / directories being added - it's like an archive
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

non recursive search in the current directory only

Hi, Am trying for a script which should delete more than 15 days older files in my current directory.Am using the below piece of code: "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/ls -altr {} \;" "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/rm -f {} \;" ... (9 Replies)
Discussion started by: puppala
9 Replies

2. Programming

recursive copy of the directory

I want to copy a directory recursively ( it again has directories) and the directory is on windows and is nfsmounted in vxWorks, i am using unix to develop the code for this, can any one suggest me how to copy the directories recursively. (7 Replies)
Discussion started by: deepthi.s
7 Replies

3. Programming

Recursive remove directory.

What is the best way to completely remove dir with it's content ??? rmdir deletes only EMPTY dirs as i know. The man page of remove function says "remove() deletes a name from the file system." Can it remove any dir recursively ??? :rolleyes: (7 Replies)
Discussion started by: Trump
7 Replies

4. UNIX for Dummies Questions & Answers

recursive wc on a directory?

Hi all, I need to count the number of lines in all the files under a directory (several levels deep). I am feeling extremely dumb, but I don't know how to do that. Needless to say, I am not a shell script wiz... Any advice? thanks in advance! (13 Replies)
Discussion started by: bimba17
13 Replies

5. Shell Programming and Scripting

Move all files from source to destination directory based on the filename

Move all files starting with a specific name to different directory. This shell script program should have three parameters File Name Source Directory Destination Directory User should be able to enter ‘AB_CD*' in file name parameter. In this case all the files starting with AB_CD will... (1 Reply)
Discussion started by: chetancrsp18
1 Replies

6. Shell Programming and Scripting

Rsync move with symlinks

Hi, I use rsync to move from source to target, but there are cases that I need to exclude: Suppose in my file system, I have a soft link ~/data -> /media/volgrp/data. Under data folder, there is a file hello.txt. After moving command "rsync --remove-source-files -aH --force ~/data/... (3 Replies)
Discussion started by: huangyingw
3 Replies

7. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

8. UNIX for Dummies Questions & Answers

How to move gz files from one source directory to destination directory?

Hi All, Daily i am doing the house keeping in one of my server and manually moving the files which were older than 90 days and moving to destination folder. using the find command . Could you please assist me how to put the automation using the shell script . ... (11 Replies)
Discussion started by: venkat918
11 Replies

9. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies

10. UNIX for Beginners Questions & Answers

Move directory with rsync and delete from source

I need a rsync command which will exclude certain files and directories from source and copy the rest. I got this command working, sudo rsync -avzh --exclude 'bin' --exclude 'braintree' --exclude 'colinmollenhour' --exclude 'composer' --exclude 'doctrine' --exclude 'fabpot' --exclude... (2 Replies)
Discussion started by: Siddheshk
2 Replies
DH_LINKTREE(1)							  dh_linktree 0.3						    DH_LINKTREE(1)

NAME
dh_linktree - create symlink trees to embed files from other packages SYNOPSIS
dh_linktree [debhelper options] [-A] [-Xitem] [action source destination ...] DESCRIPTION
dh_linktree is a debhelper program that creates symlink trees in package build directories. The symlinks points to files provided by other packages and which have to be present during build. As such you have to put the packages providing the destination files in the build dependencies. For any symlink it creates, it will add to ${misc:Depends} the dependency that is required to ensure that the target of the symlink is available. RATIONALE
This tool has been developed to handle the case of embedded libraries written in interpreted languages (javascript, PHP, etc.). You usually want to replace the embedded copy by the packaged one except if they are not compatible. Since both versions evolve separately, you might have to frequently switch between the embedded version and the packaged one. If the embedded library had been replaced by a symlink to the top-level directory, you would have to add code to the preinst/postinst every time that you switch from one to the other (to replace the real directory with a symlink and vice-versa). With a symlink tree, dpkg is doing everything by itself. Since symlink trees are created statically at build-time, they are not very future-proof and have a risk to miss some files introduced by a newer version of the package providing the file tree which is duplicated. That's why the generated dependencies generally ensure that the same upstream version be used at run-time than at build-time. USAGE
dh_linktree accepts arguments by set of 3. One action followed by source and destination file/directories. Symlinking files works just like dh_link but symlinking directories will recreate the same directory hierarchy and all individual files will be turned into symlinks. The source files are the already existing files that will be symlinked from. The destination files are the symlinks that will be created. Be sure you do specify the full filename to both the source and destination files (unlike what you would do if you were using something like ln(1)). dh_linktree will generate symlinks that comply with Debian policy aXX absolute when policy says they should be absolute, and relative links with as short a path as possible. It will also create any subdirectories it needs to to put the symlinks in. Note that dh_linktree will not be executed automatically by dh, you need to use dh $@ --with linktree to get it hooked in the list of dh_* commands automatically executed by dh. FILES
debian/package.linktrees Lists source and destination trees to be symlinked. Each line consists of 3 fields: the action, the source directory, the destination directory. should be put on its own line, with the source and destination separated by whitespace. OPTIONS
-Xitem, --exclude=item Do not create symlinks for files that contain item anywhere in their filename. action source destination ... If the action is "embed" create a symlink tree named destination with all files within it pointing to the corresponding file in source. It generates a strong dependency ("exactly same upstream version"). The "deduplicate" action will not create new files but it will replace existing files in the destination directory with symlinks to the corresponding source file provided that both files have the same content. It generates a strong dependency. The "replace" action is like "deduplicate" except that it does replace existing files even if their content is different from the content of the source files. It generates a weak dependency ("at least the current upstream version") on the basis that you already assume that both version are compatible, otherwise you would have used "deduplicate" or "embed". EXAMPLES
dh_linktree embed usr/share/javascript/jquery usr/share/wordpress/plugin-jquery Make plugin-jquery be a symlink tree to jquery. ERRORS
dpkg-query: no path found matching pattern /some/file. [...] dh_linktree: error: dpkg --search -- /some/file [...] gave error exit status 1 You get this error when the source tree contains files (here /some/file) that are not managed by dpkg. dh_linktree can't generate a correct dependency for a file that is unknown to dpkg and thus fails. SEE ALSO
debhelper(7) This program is a part of debhelper. AUTHOR
Raphael Hertzog <hertzog@debian.org> Joey Hess <joeyh@debian.org> dh_linktree 0.3 2012-06-08 DH_LINKTREE(1)
All times are GMT -4. The time now is 08:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy