Move automatically files to trash

Hi,

it is possible, move automatically files older 2 days (saved on encrypted repository) to the trash, and delete there with GC?

I have found this documentation: https://manual.seafile.com/maintain/seafile_gc.html

Point: 2

You can setup library History for 2 days. so if you delete(read move to trash) some file. It should be deleted by GC(running in cron?). But I think that, if you deleted file with CreateAt date older then 2 days after, it will stay in Trash for next 2 days. So I expect that you are not using history for files. May will be better to full disable history then it should work.

It is not possible.

@shoeper can you explain it more? I thougth that’s how GC work.

He is not talking about running the GC but deleting regular files after 2 days as I understood. And that is not possible.

I guessing(build on tons older topics here) he don’t talk how to delete files after 2 days. He asking if he delete files older then two days if is there way to wipe deleted files from trash, history and file system(seafile-data folder). Maybe we are both right :smiley:

this question is an alternative of massive deletion.

if is not possibile have a massive deletion on older files, i must try another solutions.

the idea is:

  • move automatically files older 2 day on trash
  • run cron job with GC to delete this.

it is good and works, it is possibile?

As multiple people have already told you in your other thread, deleting files server side without mounting the library as a client is not supported.

Mount the library as a client first and you can do anything you want to do. The world is your oyster :slight_smile:

  1. There are multiple ways to delete files older then two days.
  • Sync folders over client
  • Use API - I think this is best way for you cause as I understand your problem, you want to do it automatically on all libraries, so previous way need to know which library and sync them manually. And you can write little script which you can run over CRON job.
  1. And yes, then just run GC in cron job.

So result is. You can have two CRON jobs which do what you want. BUT you have to disable History data in all libraries.