please alway specify the (exact) version(s) you are currently using, this makes it easier to try to reproduce the issue. The os can in some cases also be interesting, but for this one it probably does not matter.

That being said…

calling z-push-admin -a remove --days-old 100 does indeed give the message Not possible to remove data [..] This is since the remove action always need either the username or a device id passed (as the error states). But the help text of z-push-admin could indeed be interpreted in a way that z-push-admin -a remove --days-old 100 should work, while actually it needs to be z-push-admin -a remove -u some-user --days-old 100

i tried z-push-admin -a remove -u some-user --days-old 100 before, but that removed all states of that user.

hm… that is not the case on my system. for me it removes only items that are listed with -a lastsync -u some-user and additionally also gives Some devices might not have been removed because of --days-old parameter. Check Z-Push log file for more details.

calling z-push-admin -a remove --days-old 100 does indeed give the message Not possible to remove data [..] This is since the remove action always need either the username or a device id passed (as the error states). But the help text of z-push-admin could indeed be interpreted in a way that z-push-admin -a remove --days-old 100 should work, while actually it needs to be z-push-admin -a remove -u some-user --days-old 100

The manual entry for --days-old doesn’t state explicitly that using it with remove username or device id or both are required, but in the actions’ part of the manual all remove entries contain at least one parameter whereas actions without a parameter like list or lastsync don’t.

@Manfred :
yes, the user had an active mobilephone client, 0 days old and it deleted that too.

@fbartels
yes, that usecase is correct. we have a server with around 25 users working on it. whenever a user get’s a new mobile, the old one is still available in z-push states but not used anymore. so it’s just a “cleanup of unused devices”.
but it can be done with the workaround:
z-push-admin -a lastsync --days-old 100 | sed 1,5d | cut -d" " -f1 | sed ‘/^$/d’ | while read line; do z-push-admin -a remove -d $line; done

so this isn’t really an urgent thing for me, maybe you can add it in a future release.