Ubuntu rm not deleting files

Posted by ILMV on Server Fault See other posts from Server Fault or by ILMV
Published on 2009-12-11T15:52:24Z Indexed on 2010/03/16 8:46 UTC
Read the original article Hit count: 503

Filed under:
|
|
|

My colleague and I have been struggling with deleting a directory and its contents.

We are working on a new version of our websites source code on Ubuntu 8.04 (dir: /var/www/websites), what we want to do is delete the websites directory and recreate it from a .tar backup we created a couple weeks ago. The purpose of this is so we can run our deployment procedure in a local environment before we do so on our live / public environment.

We use this command:

rm -r websites

This deletes the directory and the files within it.

The problem occurs when we un-tar our backup file and view the website we are getting files that don't exist in the .tar backup, in fact these files were only created a few days ago and should have been deleted.

We delete the directory once more in the manner stated above, we then create a new websites directory using the mkdir command. Strangely at this stage the 'deleted files' do not come back, but if we unpack our .tar file the 'deleted files' appear again.

Is there a way to ensure these files are deleted, or at least the pointers that associate them with said directory.

  • Our .tar backup does not include these files
  • We do not want to use the shred command
  • We do not want to use 3rd party applications
  • Solution should be functional via terminal (SSH)

Many thanks!

EDIT

Er... we fixed it. Turns out the files that are reappearing are because of a link we have to another directory (outside the /var/www/websites), we were restoring the link but not deleting the files on the other end. D'oh!

Many thanks for your help guys... friday afternoon syndrome :-)

© Server Fault or respective owner

Related posts about ubuntu

Related posts about delete