Sponsored Content
Top Forums Shell Programming and Scripting want file to regenerate after deletion Post 302354327 by frank_rizzo on Thursday 17th of September 2009 08:42:45 PM
Old 09-17-2009
try using hard links.

ie:
Code:
ln /myfs/protected/directory/master.file /myfs/dir/that/might/be/trashed/your.copy.file

if your.copy.file gets removed, you can just create another link. keep master.file in a safe place and you will always have at least one file there. the files must exist on the same file system though. the file will only be unlinked if all references are removed.
 

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
newinv(1)						      General Commands Manual							 newinv(1)

Name
       newinv - update distribution kit master inventory

Syntax
       /usr/sys/dist/newinv mi-file input-path

Description
       The  command  interactively maintains the master inventory files used for producing distributions in format. The program updates the master
       inventory for a product when changes are made to the hierarchy of files which are to be packaged in the subsets which constitute the  prod-
       uct.

       The  product  hierarchy	is  scanned to produce a list of component path names relative to input-path.  The list of path names is processed
       against the mi-file to produce a list of those files which have been removed from the product hierarchy and a list  of  those  files  which
       have been added.

       The  user is then given an opportunity to intervene and direct the inventory maintenance by editing these lists.  The user is placed in the
       editor with each list available for editing.  The editor used is the one specified by the EDITOR environment variable.  If  EDITOR  is  not
       set,  is  used.	 When editing the list of files which have been removed from the product, the user is expected to verify that the removals
       were intentional, and confirm the intent by removing the associated record from the file. When editing the list of files  which	have  been
       added to the product, the user is expected to provide flags and subset information for each new file, transforming the elements of the list
       into master inventory records.

       Both of these lists are merged with the records for the files which have not been changed to produce a new copy	of  the  master  inventory
       file.

   Arguments
       mi-file	      The  pathname of the master inventory file to be processed. If no master inventory file exists, you must create an empty one
		      before using the command.

       input-path     The name of the product hierarchy to be scanned for files belonging in the inventory. All files and directories found  below
		      the input-path will be processed as belonging in the inventory.

Restrictions
       The default text editor if not specified in $EDITOR is

       Files  in the product hierarchy cannot be excluded from the master inventory. Files can be blocked from being kitted in the final distribu-
       tion kit by setting the subset field of the master inventory record to NOSHIP.

Examples
       To update the master inventory file ULT400.mi from the hierarchy beginning at /var/kits/input, type:
	   newinv ULT400.mi /var/kits/input

Diagnostics
       newinv: where is mi-file?
       The mi-file specified on the command line cannot be found.

       input-path: bad directory.
       The input-path directory specified on the command line does not exist.

Files
       Backup copy of master inventory

       The list of files missing from the product.

       The list of files new to the product.

       Intermediate join file.

       List of all files in the product.

See Also
       kits(1), vi(1), stl_mi(5), environ(7), setld(8)
       Guide to Preparing Software for Distribution on ULTRIX Systems

																	 newinv(1)
All times are GMT -4. The time now is 06:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy