Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using --purge-days with gdrive storage #631

Open
Milz0 opened this issue Oct 23, 2024 · 2 comments
Open

Using --purge-days with gdrive storage #631

Milz0 opened this issue Oct 23, 2024 · 2 comments

Comments

@Milz0
Copy link

Milz0 commented Oct 23, 2024

Seems to have no effect with using purge-days and purge-interval while using gdrive as provider.
Files remain untouched since created date. Been 3 days.
Theres no instance of anything in logs either that it ran or failed, is this feature only for local storage?

nohup go run main.go --tls-listener 192.168.50.249:443 --purge-days 1 --purge-interval 1 --provider gdrive --basedir transfers --gdrive-client-json-filepath ./cred/oauth.json --gdrive-local-config-path ./cred/ --web-path ../transfer.sh-web/dist/ --force-https --tls-cert-file ../transfer.sh-web/cert.pem --tls-private-key ../transfer.sh-web/key.pem --log ./log.txt --max-upload-size 1048576

@stefanbenten
Copy link
Collaborator

The purge function has not been touched in about 3 years.
From looking at the code, it might be that the mode time gets updated every time someone access' the file and thus the "expiration" mechanism here will never work:

q := fmt.Sprintf("'%s' in parents and modifiedTime < '%s' and mimeType!='%s' and trashed=false", s.rootID, expirationDate, gDriveDirectoryMimeType)

@Milz0
Copy link
Author

Milz0 commented Oct 23, 2024

I think instead of looking at modifiedTime should it not be directed to createdTime as this timestamp shouldn't change on upload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@stefanbenten @Milz0 and others