Sponsored Content
Top Forums Shell Programming and Scripting want file to regenerate after deletion Post 302354253 by glev2005 on Thursday 17th of September 2009 03:33:44 PM
Old 09-17-2009
want file to regenerate after deletion

I looked into the sticky bit, but I think, if possible, that I would prefer to have the file recreate itself after deletion. The file is several directories deep, and from time to time the top level directory will be trashed. I need the file to recreate after this. Is it possible to perhaps create a symlink that, if the file is deleted, the source file will recreate it?

---------- Post updated at 03:33 PM ---------- Previous update was at 02:56 PM ----------

Any ideas are welcome!
 

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
STICKY(8)						    BSD System Manager's Manual 						 STICKY(8)

NAME
sticky -- sticky text and append-only directories DESCRIPTION
A special file mode, called the sticky bit (mode S_ISVTX), is used to indicate special treatment for shareable executable files and directo- ries. See chmod(2) or the file /usr/include/sys/stat.h for an explanation of file modes. STICKY TEXT EXECUTABLE FILES
The sticky bit has no effect on executable files. All optimization on whether text images remain resident in memory is handled by the ker- nel's virtual memory system. STICKY DIRECTORIES
A directory whose `sticky bit' is set becomes an append-only directory, or, more accurately, a directory in which the deletion of files is restricted. A file in a sticky directory may only be removed or renamed by a user if the user has write permission for the directory and the user is the owner of the file, the owner of the directory, or the super-user. This feature is usefully applied to directories such as /tmp which must be publicly writable but should deny users the license to arbitrarily delete or rename each others' files. Any user may create a sticky directory. See chmod(1) for details about modifying file modes. BUGS
Neither open(2) nor mkdir(2) will create a file with the sticky bit set. HISTORY
A sticky command appeared in Version 32V AT&T UNIX. 4th Berkeley Distribution June 5, 1993 4th Berkeley Distribution
All times are GMT -4. The time now is 10:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy