Menu

Deleting Files In Linux

Help
Kevin
2015-03-29
2024-09-23
  • Kevin

    Kevin - 2015-03-29

    I know in the FAQ that it says you should move files you want to delete to a folder that isn't monitored by snapraid, sync, and finally delete them. I wanted to know if in linux since the trash is a hidden folder that you could just put files into the trash, sync, and finally empty the trash?

    Seems like it would work but wanted to double check. I can always just make a special folder.

    -Kevin

     
    • Leifi Plomeros

      Leifi Plomeros - 2015-03-29

      It works in Windows. Don't see any reason why it wouldn't work in Linux.

      You could test this very easily:

      1. Snapraid sync
      2. Put a file in the trash.
      3. Put the file back from trash
      4. SnapRaid diff

      If diff show No differences then it is all good.
      If diff show the file as moved/copied/restored you are still good :)
      If diff shows the file as both removed and added then you have a problem.

      Edit1: Un-Joda-fied the Ifs above.
      Edit2: You may want to make sure that there is no setting to autoclean the trashcan based on trash size or % free disk space in case you intend to put big things in there.

       

      Last edit: Leifi Plomeros 2015-03-29
  • Jack

    Jack - 2024-09-23

    It works great on Debian 12.x

    On the data drives their will be a folder .Trash-0 when something has been deleted on that specific drive.

    1. sudo nano /etc/snapraid.config
    2. Under Defines files and directories to exclude
    3. Add exclude .Trash-0/
    4. Save
      How can I safely move files from one disk to another?
    5. Diff -v (to verify that the just copied files are correctly identified as 'copy'.)
    6. Check -v (Optional)
    7. Sync -h -v
    8. Delete the files from the original location.
    9. Sync -h -v

    Afterwards you can remove the deleted content from .Trash-0.
    I just delete the entire .Trash-0 folder with rm -rf /mnt/data/dataXX/.Trash-0
    The folder will be there again when deleting something from that HDD.

     

    Last edit: Jack 2024-09-23

Log in to post a comment.

MongoDB Logo MongoDB