Sponsored Content
Top Forums Shell Programming and Scripting How to Undo overwrite file in UNIX? Post 302886853 by Neo on Tuesday 4th of February 2014 03:09:59 AM
Old 02-04-2014
No. There is no "undo" command.

You should always make a backup copy of a file before you edit it; and you should always have backup copies of all files you don't want to "lose" if the files are important.

There will always be mistakes, typos, errors by humans working on computer systems. Systems will crash, drives will fail, power will go down; so you must work assuming mistakes will happen and systems may crash, and insure you have backups as you work, at all times.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

overwrite specific lines in a file

Hi all, I am trying to overwrite some lines of a very big file. I know the number of the line but I don't know how to point the cursor on its beginning. there is an option to notice the offset in lines? thanks! (7 Replies)
Discussion started by: csecnarf
7 Replies

2. UNIX Desktop Questions & Answers

shell overwrite lines in a file

Hello, I have an external file (file.txt). This shall be a kind of a config file for my shell script. I get the line numbers as to a corresponding entry by grep. Now I would like to substitute the corresponding line from the shell script back to the file and exactly on the same line number. ... (4 Replies)
Discussion started by: ACTGADE
4 Replies

3. UNIX for Dummies Questions & Answers

Restrict file overwrite through FTP

How can I restrict a user from overwriting a file once he has uploaded it through FTP. He can view the file but can't delete or overwrite it. (OS is UNIX, there is no restriction on client FTP software) Will be very glad if someone could resolve this problem. Thanks Imran Aziz Khan ... (7 Replies)
Discussion started by: imranak7
7 Replies

4. Shell Programming and Scripting

Unable to overwrite but can delete file

I'm debugging a ksh script written by someone else that does the following: It runs a command and redirects stdout to a file called dberror that already exists using ">". This command fails with the following error: The file access permissions do not allow the specified action. dberror:... (1 Reply)
Discussion started by: savage66
1 Replies

5. Shell Programming and Scripting

Undo in unix

Hi All, Is there any undo option is there in unix same as recycle bin in windows? (5 Replies)
Discussion started by: Jairaj
5 Replies

6. UNIX for Dummies Questions & Answers

overwrite file in multiple folders

I need to update the contents of a file that exists in several hundred folders. I'm on a mac. Can I use Terminal to execute a linux/unix command that will accomplish the overwriting of the file? (2 Replies)
Discussion started by: webguy262
2 Replies

7. Hardware

Undo ntfsclone --overwrite syntax error

ok so I had a dislexic moment, while typing the command ntfsclone --rescue --overwrite --force /dev/sdc3 /dev/sda3 I got the source and destination backwards so now I have a blank sdc3 I tried using gparted -->device -->attemp data rescue and it didn't help. before I screw this partition up anymore... (0 Replies)
Discussion started by: bleufox99
0 Replies

8. Shell Programming and Scripting

Shell script to overwrite a file

Hi Guys, My requirement as follows, i want to write a shell script to display the files of a folder, i export it to a file to mail the file. The problem is the exported file is getting appended every time I run the script. I just want the file to be over written. can anyone suggest?? ... (4 Replies)
Discussion started by: Karthick N
4 Replies

9. Shell Programming and Scripting

Overwrite file every day

Hi Friends, I have written a script to capture system performance every hour and redirected to output file. How to overwrite the file every next day? Thanks Suresh (4 Replies)
Discussion started by: suresh3566
4 Replies

10. Shell Programming and Scripting

Wget download file ( do not overwrite )

Hello all, I want to write auto update script for my embedded device, which can check and download newer version of my program and extract the files on the device. The download center is hosted on remote web server . Script checks the hosted file on web site and if the new version is there... (8 Replies)
Discussion started by: stefki
8 Replies
S3QLLOCK(1)							       S3QL							       S3QLLOCK(1)

NAME
s3qllock - Make trees on an S3QL file system immutable SYNOPSIS
s3qllock [options] <directory> DESCRIPTION
S3QL is a file system for online data storage. Before using S3QL, make sure to consult the full documentation (rather than just the man pages which only briefly document the available userspace commands). The s3qllock command makes a directory tree in an S3QL file system immutable. Immutable trees can no longer be changed in any way whatso- ever. You can not add new files or directories and you can not change or delete existing files and directories. The only way to get rid of an immutable tree is to use the s3qlrm command. s3qllock can only be called by the user that mounted the file system and (if the file system was mounted with --allow-other or --allow-root) the root user. This limitation might be removed in the future (see issue 155). RATIONALE
Immutability is a feature designed for backups. Traditionally, backups have been made on external tape drives. Once a backup was made, the tape drive was removed and locked somewhere in a shelf. This has the great advantage that the contents of the backup are now permanently fixed. Nothing (short of physical destruction) can change or delete files in the backup. In contrast, when backing up into an online storage system like S3QL, all backups are available every time the file system is mounted. Nothing prevents a file in an old backup from being changed again later on. In the worst case, this may make your entire backup system worthless. Imagine that your system gets infected by a nasty virus that simply deletes all files it can find -- if the virus is active while the backup file system is mounted, the virus will destroy all your old backups as well! Even if the possibility of a malicious virus or trojan horse is excluded, being able to change a backup after it has been made is generally not a good idea. A common S3QL use case is to keep the file system mounted at all times and periodically create backups with rsync -a. This allows every user to recover her files from a backup without having to call the system administrator. However, this also allows every user to accidentally change or delete files in one of the old backups. Making a backup immutable protects you against all these problems. Unless you happen to run into a virus that was specifically programmed to attack S3QL file systems, backups can be neither deleted nor changed after they have been made immutable. OPTIONS
The s3qllock command accepts the following options: --debug activate debugging output --quiet be really quiet --version just print program version and exit EXIT STATUS
s3qllock returns exit code 0 if the operation succeeded and 1 if some error occurred. SEE ALSO
The S3QL homepage is at http://code.google.com/p/s3ql/. The full S3QL documentation should also be installed somewhere on your system, common locations are /usr/share/doc/s3ql or /usr/local/doc/s3ql. COPYRIGHT
2008-2011, Nikolaus Rath 1.11.1 August 27, 2014 S3QLLOCK(1)
All times are GMT -4. The time now is 05:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy