Forums

×

Warning

JUser: :_load: Unable to load user with ID: 26800
Medium
Offline
Resolved
-1 votes
Hello,

Please help!!!

How flexshare's recycle bin works? I deleted 10GB files, it's end up .trash folder. Then I need delete it again. Does ClearOS clean flexshare's trash folder?

Is there any scrip or settings to delete them like 30days?

If user wants to retrieval files, is there any other place to see?

Thanks in advance.
Monday, September 06 2010, 10:57 PM
Share this post:
Responses (17)
  • Accepted Answer

    Wednesday, September 08 2010, 03:08 PM - #Permalink
    Resolved
    0 votes
    Hi a22.


    How flexshare's recycle bin works? I deleted 10GB files, it's end up .trash folder. Then I need delete it again. Does ClearOS clean flexshare's trash folder?


    As you have discovered, the deleted files end up in the .trash folder. If you delete the files from .trash folder, those files will be completely deleted.

    Is there any scrip or settings to delete them like 30days?


    Nope, but that would be a nice feature.

    If user wants to retrieval files, is there any other place to see?


    The .trash folder is the only place.
    The reply is currently minimized Show
  • Accepted Answer

    Ryan
    Ryan
    Offline
    Friday, September 10 2010, 02:50 AM - #Permalink
    Resolved
    0 votes
    adding a script to the etc/cron.daily/ directory with the following

    find /var/flexshare/shares/*/.trash/ -mtime +30 -exec rm {} \;

    deletes all files with a modified date older than 30 days from all the .trash folders in flexshares
    The reply is currently minimized Show
  • Accepted Answer

    Friday, September 10 2010, 09:01 AM - #Permalink
    Resolved
    0 votes
    Nice! :)
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, September 12 2010, 08:58 PM - #Permalink
    Resolved
    0 votes
    Thanks for all your answers. That helps a lot. :laugh:
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, May 08 2011, 09:01 AM - #Permalink
    Resolved
    0 votes
    hi

    that commad should help me too but is there a way that it can be modified to empty user trash as well??

    cheers

    Andy
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, May 08 2011, 12:09 PM - #Permalink
    Resolved
    0 votes
    I don't have any but if you tell me where the user trash is located I can try and help. At a guess it is under the /home folder.
    The reply is currently minimized Show
  • Accepted Answer

    Harley
    Harley
    Offline
    Thursday, October 13 2011, 03:01 AM - #Permalink
    Resolved
    1 votes
    Thanks!
    The reply is currently minimized Show
  • Accepted Answer

    Duncan
    Duncan
    Offline
    Friday, October 28 2011, 10:18 PM - #Permalink
    Resolved
    0 votes
    Ryan wrote:
    adding a script to the etc/cron.daily/ directory with the following

    find /var/flexshare/shares/*/.trash/ -mtime +30 -exec rm {} \;

    deletes all files with a modified date older than 30 days from all the .trash folders in flexshares


    nice, thanks.

    As root I created "empty-trash" in the cron.daily with the line in and then chmod it 755, this should be sufficient to make sure it execute properly?
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, October 29 2011, 11:29 PM - #Permalink
    Resolved
    0 votes
    Question wouldn't you need to add in rm -f -r if you have directory in trash?

    How could I build this into the flexshare webui tab because I was thinking about it

    And I wonder if you can run it through pipe-viewer and output the progress bar and print its status inside the webui I use pv for watching the progress of tar files
    The reply is currently minimized Show
  • Accepted Answer

    Scumbag
    Scumbag
    Offline
    Thursday, April 26 2012, 02:16 AM - #Permalink
    Resolved
    0 votes
    What would be nice would be to remove any empty directories after deleting the old trash files. Presumably it would need to run several times or be clever enough to check parent directories so it could remove directories that became empty as a result of removing empty directories within them.

    Anyone got any thoughts on this? Thanks.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, May 16 2012, 06:12 PM - #Permalink
    Resolved
    0 votes
    Here is a simple script that I utilize on my servers. This and CRON are your friends. Hope this helps!

    #!/bin/sh
    # remove_q_recycle.sh
    # intended to scan and delete files from under the server recycle directory older than XX minutes (mmin variable) or xx days (-mtime)
    # run nightly ???
    find /sec/Qdrive/.recycle -mtime +12 -exec rm -f {} \;
    The reply is currently minimized Show
  • Accepted Answer

    Duncan
    Duncan
    Offline
    Saturday, September 15 2012, 06:23 PM - #Permalink
    Resolved
    0 votes
    Im revisiting this to set up a 6.3 server.

    Im finding the commands given previously will delete files as specified but leaving behind the empty directory structures in trash.

    Is there a command or set of commands which will clean all files AND folders left in trash, say after 30 days.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, September 15 2012, 08:24 PM - #Permalink
    Resolved
    0 votes
    I run the following via cron every night.

    find /sec/.recycle -mtime +12 -exec rm -f {} \;
    find /sec/.recycle -mtime +12 -exec rmdir -v {} \;


    Obviously my recycle bin is located in the .recycle directory. The 1st command removes files if older than 12 days in this case. The second removes directories, but only empty ones. Its not perfect. It can take an extra couple of runs to clean up directories, but it does work.
    The reply is currently minimized Show
  • Accepted Answer

    Duncan
    Duncan
    Offline
    Sunday, September 16 2012, 07:48 AM - #Permalink
    Resolved
    0 votes
    Thanks very much, gone with the following.


    find /var/flexshare/shares/*/.trash/ -mtime +30 -exec rm -f {} \;
    find /var/flexshare/shares/*/.trash/ -mtime +30 -exec rmdir -v {} \;
    find /home/*/.trash/ -mtime +30 -exec rm -f {} \;
    find /home/*/.trash/ -mtime +30 -exec rmdir -v {} \;
    The reply is currently minimized Show
  • Accepted Answer

    Friday, November 23 2012, 09:48 PM - #Permalink
    Resolved
    0 votes
    I would check for empty folders, before deleting, below my update ...

    find /var/flexshare/shares/*/.trash/ -mtime +30 -exec rm -f {} \;
    find /var/flexshare/shares/*/.trash/ -type d -empty -mtime +30 -exec rmdir -v {} \;
    find /home/*/.trash/ -mtime +30 -exec rm -f {} \;
    find /home/*/.trash/ -type d -empty -mtime +30 -exec rmdir -v {} \;
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, December 01 2020, 01:06 PM - #Permalink
    Resolved
    0 votes
    how do I activate this .trash folder?
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, December 02 2020, 05:18 PM - #Permalink
    Resolved
    1 votes
    Better not to activate an 8 year old post! I've replied to your other thread.
    The reply is currently minimized Show
Your Reply