LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Files being wiped after theyre modified. (https://www.linuxquestions.org/questions/linux-newbie-8/files-being-wiped-after-theyre-modified-758182/)

onesikgypo 09-28-2009 02:37 AM

Files being wiped after theyre modified.
 
Hi,

I have this weird, and frustrating, problem where at times, once a file is accessed and saved via nano - the contents of the whole file is wiped. This only happens some of the time.

Also, once the file has been wiped, if i try to write anything afterwards to it, it says it writes successfully, but if i hit ctrl+x to quit, then immediately access it again, it will be blank.

If i go into a root account, and i edit the file, i can successfully open, and save something in its content, but then if i again access it through my user account, i will see the changes there, but if i try to modify it, it immediately goes back to how it was before - being unabel to be written to

The file itself is in /usr/bin - if i try writing something in my local folder, it writes fine, saves fine and is accessed fine.

Any Help would be greatly appreciated, thankyou.

brianL 09-28-2009 03:27 AM

You've answered your own question. You can only permanently modify files outside your home directory as root.

onesikgypo 09-28-2009 03:37 AM

Quote:

You've answered your own question. You can only permanently modify files outside your home directory as root
No, this wasnt the problem, i had previously always been able to edit scripts in /usr/bin - and the files were all chmod 777 - further if i didnt have permission, this would not explain why 200 lines of coding would suddenly vanish when i was attempted to make a small change. itd merely refuse to make any changes, not wipe the file.

I managed to find, what i think, was the cause of the problem. The partition where all the system files are held, that is '/' had no space free, as a result of thousands of clientmqueue files, which im confused as to how why they accumulated since the sendmail service was switched off. I was able to write stuff to my home dir, since /home is on a much larger patition with lots of free space. Anyway, after i deleted the files in /var/spool/clientmqueue, i could once again edit scripts fine from my user account (till now im not exactly sure why root was still able to, maybe it was just coincidence that there was some free space when i tried on root, or alike)

So as far as i can understand, anyone who has a similar problem, make sure you check you have sufficient df space.


All times are GMT -5. The time now is 06:54 PM.