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

removing files with --older-than option does not work in newer version of mc #2341

Closed
rwsgithubcf opened this issue Dec 21, 2017 · 4 comments · Fixed by #2354
Closed

removing files with --older-than option does not work in newer version of mc #2341

rwsgithubcf opened this issue Dec 21, 2017 · 4 comments · Fixed by #2354
Assignees
Milestone

Comments

@rwsgithubcf
Copy link

Expected behaviour

mc rm with --older-than option should remove older files

Actual behaviour

nothing is removed

Steps to reproduce the behaviour

----- the version of 12-12-2017 does not remove older files (mc find can still find them afterwards)

+ mc version
Version: 2017-12-12T01:08:02Z
Release-tag: RELEASE.2017-12-12T01-08-02Z
Commit-id: 4cb6e3534286819d3e11db7c3659164655020bd3
+ mc find backup/mysqlbackup/testv1 --print '{time} {}' --older 9d
2017-12-12 01:37:39 CET backup/mysqlbackup/testv1/2017/12/12/mysql-backup-1513036800-0.tar.gpg
2017-12-12 01:35:28 CET backup/mysqlbackup/testv1/2017/12/12/mysql-backup-1513036800-0.txt
+ mc rm backup/mysqlbackup/testv1 -r --force --older-than 9
Removing `backup/mysqlbackup/testv1`.
+ mc find backup/mysqlbackup/testv1 --print '{time} {}' --older 9d
2017-12-12 01:37:39 CET backup/mysqlbackup/testv1/2017/12/12/mysql-backup-1513036800-0.tar.gpg
2017-12-12 01:35:28 CET backup/mysqlbackup/testv1/2017/12/12/mysql-backup-1513036800-0.txt

----- the version of 14-10-2017 does remove older files (mc find can no longer find them)

+ /home/brouwero/tools/mc version
Version: 2017-10-14T00:51:16Z
Release-tag: RELEASE.2017-10-14T00-51-16Z
Commit-id: 785e14a725357b39e22b74483cd202e7effa6195
+ /home/brouwero/tools/mc find backup/mysqlbackup/testv1 --print '{time} {}' --older 9d
2017-12-12 01:37:39 CET backup/mysqlbackup/testv1/2017/12/12/mysql-backup-1513036800-0.tar.gpg
2017-12-12 01:35:28 CET backup/mysqlbackup/testv1/2017/12/12/mysql-backup-1513036800-0.txt
+ /home/brouwero/tools/mc rm backup/mysqlbackup/testv1 -r --force --older-than 9
Removing `backup/mysqlbackup/testv1/2017/12/12/mysql-backup-1513036800-0.tar.gpg`.
Removing `backup/mysqlbackup/testv1/2017/12/12/mysql-backup-1513036800-0.txt`.
Removing `backup/mysqlbackup/testv1/2017/12/12/`.
Removing `backup/mysqlbackup/testv1/2017/12/13/`.
Removing `backup/mysqlbackup/testv1/2017/12/14/`.
Removing `backup/mysqlbackup/testv1/2017/12/15/`.
Removing `backup/mysqlbackup/testv1/2017/12/16/`.
Removing `backup/mysqlbackup/testv1/2017/12/17/`.
Removing `backup/mysqlbackup/testv1/2017/12/18/`.
Removing `backup/mysqlbackup/testv1/2017/12/19/`.
Removing `backup/mysqlbackup/testv1/2017/12/20/`.
Removing `backup/mysqlbackup/testv1/2017/12/21/`.
Removing `backup/mysqlbackup/testv1/2017/12/`.
Removing `backup/mysqlbackup/testv1/2017/`.
Removing `backup/mysqlbackup/testv1/`.
+ /home/brouwero/tools/mc find backup/mysqlbackup/testv1 --print '{time} {}' --older 9d

mc version

Version: 2017-12-12T01:08:02Z
Release-tag: RELEASE.2017-12-12T01-08-02Z
Commit-id: 4cb6e3534286819d3e11db7c3659164655020bd3

Also see above for a comparison

System information

Found the problem running in a container built with the following Dockerfile:

FROM ubuntu:latest
RUN apt-get update && apt-get install -y wget curl jq
ENV CF_CLI_VERSION "6.33.0"
RUN curl -L "https://cli.run.pivotal.io/stable?release=linux64-binary&version=${CF_CLI_VERSION}" | tar -xz -C /usr/local/bin
RUN wget https://dl.minio.io/client/mc/release/linux-amd64/mc && chmod +x mc && mv mc /usr/local/bin

Reproduced the issue on a RHEL server as well where I manually ran the same wget command to install mc

Linux nwr-itvl-cfb001 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
@poornas
Copy link
Contributor

poornas commented Dec 21, 2017

@rwsgithubcf, noticed you don't have a trailing / for the prefix you are trying to remove.
/home/brouwero/tools/mc rm backup/mysqlbackup/testv1/ -r --force --older-than 9
should work.

@deekoder
Copy link
Contributor

@rwsgithubcf let us know if that worked.

@poornas
Copy link
Contributor

poornas commented Dec 28, 2017

@rwsgithubcf , are you still having issues after adding trailing "/" to the prefix in mc rm command?

nitisht pushed a commit that referenced this issue Jan 12, 2018
mc rm --r with prefix not terminated by / doesn't get deleted.
example: mc rm --r --force --older-than=10 play/test/prefix

Fixes: #2341
@nitisht nitisht added fixed and removed triage labels Jan 12, 2018
@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants