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

Backup-clean-files: integer expression expected #5814

Closed
edospadoni opened this issue Aug 29, 2019 · 4 comments

Comments

@edospadoni
Copy link
Member

commented Aug 29, 2019

Steps to reproduce

  • rm -f /var/lib/nethserver/backup/restore/*
  • /etc/backup-data.hooks/backup-clean-files <backup-data-name>

Expected behavior
Clean command output

Actual behavior
/etc/backup-data.hooks/backup-clean-files: line 48: [: *: integer expression expected

Components
nethserver-restore-data

See also
https://community.nethserver.org/t/backup-clean-files-line-48-integer-expression-expected/13302

edospadoni added a commit to NethServer/nethserver-restore-data that referenced this issue Aug 29, 2019

@edospadoni edospadoni added the testing label Aug 29, 2019

@edospadoni

This comment has been minimized.

Copy link
Member Author

commented Aug 29, 2019

Test case:

  • check the bug is not reproducible

@edospadoni edospadoni added the bug label Aug 29, 2019

@nethbot

This comment has been minimized.

Copy link
Member

commented Aug 29, 2019

in 7.6.1810/testing:

@gsanchietti

This comment has been minimized.

Copy link
Member

commented Aug 29, 2019

Tested with: bash -x /etc/backup-data.hooks/backup-clean-files backup-data.

Before update:

+ backup=backup-data
+ log=
+ exit_code=
+ epoch=
++ /sbin/e-smith/db backups gettype backup-data
+ type=duplicity
+ '[' duplicity = duplicity ']'
++ /usr/bin/date +%Y-%m-%d
+ now=2019-08-29
++ /sbin/e-smith/db backups getprop backup-data CleanupOlderThan
++ /usr/bin/cut -d D -f1
+ prune=1
+ [[ 1 == \n\e\v\e\r ]]
++ /usr/bin/date '--date=2019-08-29 -1 day' +%s
+ timestamp_diff=1566943200
+ for b in '/var/lib/nethserver/backup/restore/${backup}\@*'
++ /usr/bin/cut -d @ -f2
++ /usr/bin/cut -d . -f1
++ /usr/bin/echo '/var/lib/nethserver/backup/restore/backup-data@*'
+ backup_timestamp='*'
+ '[' '*' -le 1566943200 ']'
/etc/backup-data.hooks/backup-clean-files: line 49: [: *: integer expression expected
+ '[' duplicity = rsync ']'

After update:

+ backup=backup-data
+ log=
+ exit_code=
+ epoch=
++ /sbin/e-smith/db backups gettype backup-data
+ type=duplicity
+ '[' duplicity = duplicity ']'
++ /usr/bin/date +%Y-%m-%d
+ now=2019-08-29
++ /usr/bin/cut -d D -f1
++ /sbin/e-smith/db backups getprop backup-data CleanupOlderThan
+ prune=1
+ [[ 1 == \n\e\v\e\r ]]
++ /usr/bin/date '--date=2019-08-29 -1 day' +%s
+ timestamp_diff=1566943200
++ find /var/lib/nethserver/backup/restore/ -name 'backup-data@*'
+ '[' duplicity = rsync ']'

This is verified for me.

I'm waiting for confirmation from the reporter.

@gsanchietti gsanchietti added verified and removed testing labels Aug 29, 2019

@nethbot

This comment has been minimized.

Copy link
Member

commented Aug 30, 2019

in 7.6.1810/updates:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.