Avoiding accidental delete of files on external hard disc [closed] - file-io

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Recently I deleted my huge collection of data that I stored in my hard disc accidentally. I recovered it using some recovery software.
But I want to set my hard disc in such a way that, nobody can delete the files, even it is administrator of my system or other system , until the permission is changed.
I don't like to use any external software for my need.
What can I do?

The closest you can get to this, on Linux and OS X, at least, is setting the sticky bit on the directory containing the files and changing the owner of the directory and those files to a dummy user.
chmod +t /path/to/dir
chown -R someone /path/to/dir
The sticky bit makes it so only the file owner or root (or, on OS X, someone with write access to the directory) can delete or rename files in a directory.

Related

Backup Mantis [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I want to fully backup my Mantis tracking system, what is the easiest way to do this?
If I only backup the database, does it backup everything on Mantis already?
Thanks!!
To completely backup Mantis, the database state must be saved. In addition, you should back up the following files or directories:
the upload directory, if Mantis is configured to store attachments on disk;
the config_inc.php file
any other custom files, like custom_strings_inc.php or custom_constant_inc.php

Recovery of SSH session after system crash [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I was editing a file over SSH when my computer crashed and I got the BSOD. I was SSHing through Putty. I would really like to recover if possible. I don't know if there is anyway to restore the SSH session and save from there. Any help would be appreciated.
No, there is no way to restore your session, unless you used something like screen.
But there might be a way to restore your file, but that depends on the editor you used. Editors like Vim and Emacs store the changes of unsaved files, and will notify you the next time you open the file.
Thus all you have to do in this case is open the same file again. In other cases the changes might just be gone.

Debian, apache. Log files eats up all disk space [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I only have 32 GB disk space on my VPS, and currently the logfiles takes 26 GB. I found the files: access.log.1 and error.log.1, which is 17 gb together (var/log/apache2).
Can I just remove these files to free up some space?
Is it possible to stop the logging function? I know very litte about servers, and don't understand the logs anyways.
Thanks
if you dont need them, then remove it.
maybe you should install logrotate to delete these files automaticly after some time.
the access and error logs are mostly used for debugging (in my case) or for statistics or because of legal reasons.
You can also disable them: just comment out the lines regarding log in the config for the site (/etc/apache2/sites-available/*)

How to use cp.exe from Cygwin and preserve permissions [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm using cp.exe from Cygwin to copy files in Windows 7. Unfortunately, when I do the permissions of the file change.
I've tried using:
cp --preserve=all
But that doesn't work either, and when I check the security of the original file vs the copy, the copy has different permissions.
Clearly there must be a way to preserve permissions when copying using Cygwin, but I can't find it.
I believe adding option noacl to the /cygdrive mount point in /etc/fstab will do what you want.
$ cat fstab
# For a description of the file format, see the Users Guide
# http://cygwin.com/cygwin-ug-net/using.html#mount-table
# This is default anyway:
# none /cygdrive cygdrive binary,posix=0,user 0 0
none /cygdrive cygdrive binary,posix=0,user,noacl 0 0
See http://cygwin.com/cygwin-ug-net/using.html#mount-table and discussion from the cygwin mailing list.
I did some more investigation about this after asking the question above.
Per this discussion with one of Cygwin's developers, it appears that Cygwin doesn't care about Windows permissions, and just sticks with the POSIX ones.
From what I can tell, POSIX permissions are a whole separate thing from the Windows ones, so yes, it's great that they're supported, but ultimately, Cygwin can't copy files and maintain normal Windows permissions. Making it useless to me. Much better to use Python or Ruby.
I would love to be proven wrong though.

How do I run robocopy without copying extended attribute information? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Greetings,
I've got a bat script which copies certain information from a computer onto a USB hard drive using Robocopy. The hard drive is FAT formatted and therefore doesn't support directories with extended attributes, leading me to robocopy error 282 as described here.
How do I tell robocopy to copy all the attribute information EXCEPT for the extendable attributes?
I still need help, but, some helpful info from the googling ive done thus far
Robocopy Command-Line Options: http://www.ss64.com/nt/robocopy.html
What is an Extended File Attribute: http://en.wikipedia.org/wiki/Extended_file_attributes
Windows Hotfix (which would be great if I wasn't copying to a USB hard drive): http://support.microsoft.com/kb/329145/en-us
EDIT: Wow, the file system isn't FAT, I was wrong. Its RAW.
I found I only got the 282 error when copying direcories with robocopy. So I used xcopy with /T /E to create the directory structure. I was then able to use robocpy to copy all the files without error.
Convert FAT USB hard drive to NTFS using convert command (converting in this direction won't delete the data):
http://technet.microsoft.com/en-us/library/bb456984.aspx
eg:
convert e: /fs:ntfs