Sponsored Content
Top Forums Shell Programming and Scripting want file to regenerate after deletion Post 302354270 by glev2005 on Thursday 17th of September 2009 03:52:39 PM
Old 09-17-2009
peterro, Thanks for answering.. I was wondering if there was something simpler.. Like a way to actually have a symlink that, if the target file was deleted, that the source file would recreate it.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File deletion when server restarts

Hi, In a shell script I am makin use of 3 files f1,f2 and f3.txt. When the Unix server is restarted I want to delete all these 3 files if they are existing. ( I suppose I will have to use this command rm /thefilepath/f* but dont know in which script to use.) Anyone knows what can be... (6 Replies)
Discussion started by: k_oops9
6 Replies

2. UNIX for Dummies Questions & Answers

Deletion of File in Unix

Hi there guys. I'm quite new in using unix and just recently experienced missing file problem. Someone accidentally or likely intentionally deleted one specific folders that contains important file. Now my question is, can any other user aside from root can do such action? Please help. ... (2 Replies)
Discussion started by: rhomel101
2 Replies

3. UNIX for Dummies Questions & Answers

large file deletion

OS: Solaris 8 I deleted a large file (around 13 Gigs) from my system. But the output of df -k remains the same. The capacity % is constant. However one strange thing is happening- My available space is decreasing, my used space in increasing (The opposite should happen). This is happening... (2 Replies)
Discussion started by: run_time_error
2 Replies

4. UNIX for Dummies Questions & Answers

file deletion problem

I am using unix via telnet ssh and i have a problem I was testing the server. I made a directory. Transfered a file from an ftp to it. Opened the file with the vi text editor --This where my problem came..... I tried deleting the file using rm somefile.htm when is typed ls i noticed that... (2 Replies)
Discussion started by: shdwsclan
2 Replies

5. Shell Programming and Scripting

Prompting for file deletion?

I got help in another forum but now I need further help so I figured I'd ask here. I had to write a script to delete certain filenames of certain size. I got this far.. find . -size 110c -name "*testing*" -print | xargs -n 1 rm -i It finds the correct files, but the prompts to delete are all... (2 Replies)
Discussion started by: NycUnxer
2 Replies

6. Programming

How to watch for file creation/deletion?

How do I write a C program that will watch a directory for file creation/deletion? Maybe it would receive a signal when someone creates a file? thanks, Siegfried (5 Replies)
Discussion started by: siegfried
5 Replies

7. Shell Programming and Scripting

Deletion of lines in a text file

Hi Everyone, Please help me with this. I have gone through many posts here but couldn't find what I wanted. I have a file with 79000+ lines and I want to delete lines in a pattern. I want to delete every 141st line in the file, starting from line 2000 till 50000. Please help guys. ... (8 Replies)
Discussion started by: max29583
8 Replies

8. UNIX for Dummies Questions & Answers

How Do I Regenerate the Shadow file

I guess the earlier problem I had with changing user passwords and creating new users is related to the shadow file. Anytime I change something to /etc/passwd or shadow I get locked out. HOW DO I REGENERATE THIS FILE. (1 Reply)
Discussion started by: Waitstejo
1 Replies

9. Shell Programming and Scripting

File content deletion

Hi Everyone, There are certain files under a folder 'ABC' and the entries for these files are there in another file(fname) under a different folder 'XYZ'. I want to compare the folder contents(ABC) with the file(fname) contents and delete the mismatching / non-existing ones from the file,... (4 Replies)
Discussion started by: swasid
4 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:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy