The answer is yes of course :-)

There may be several ways to do this, here is one that come to my mind.

You can define a custom trash policy like this:


define_policy trash {
     status_manager = basic;
     scope { type == file and status != 'ok' }
     default_action = cmd("move_to_trash.sh {path}");
     default_lru_sort_attr = none;
}

For a given file /scratch/X/Y/Z, you custom script "move_to_trash.sh" would create the "/scratch/.trash/X/Y" directory and move Z to it.

Then define your "trash_rules" exactly like you did with the cleanup policy.

useful commands:
> rbh-report --status trash
will give a summary of the trashed files. It reports "OK" for the files that have been moved to trash, "failed" if the move did fail, and report no status for all other files (not moved to trash).

> rbh-find -status trash:ok
list you the files succesfully moved to trash, etc...

Don't forget to blacklist the trash directory from your trash policy, or you would trash your trash :-D

trash_rules {
    ignore { tree == "/scratch/.trash" }

    ...
}

Regards,
Thomas

On 03/07/18 00:12, John White wrote:
I think I know the answer to this, but I'd like to confirm - Is there a way to 
craft a migration policy that would simply move files to a new location within 
the bounds of a single file system?

Given the files /scratch/A, /scratch/B, /scratch/C, file C is flagged for 
migration due to age (>130d).  Migrate /scratch/C to /scratch/.purged/scratch/C 
(preserving the directory structure in /scratch/.purged)?

The idea being an attempt to soften the blow of an initial purge on inattentive 
users.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
robinhood-support mailing list
robinhood-support@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/robinhood-support


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
robinhood-support mailing list
robinhood-support@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/robinhood-support

Reply via email to