Kopano cleanup not functioning
-
No one a idea?
-
@BMWfan The latest version of the script can be found in the Core-tools bitbucket repository: https://stash.kopano.io/projects/KSC/repos/core-tools/browse/kopano-cleanup
I have also updated the KB article with the correct link…
-
@bhuisman thanks.
But the problem still exists:
python kopano-cleanup.py --user Daniel --junk --wastebasket --days 10 Running script for 'Daniel' Traceback (most recent call last): File "kopano-cleanup.py", line 121, in <module> main() File "kopano-cleanup.py", line 107, in main deleteitems(options, user, folder) File "kopano-cleanup.py", line 88, in deleteitems print('Deleted {} item(s) for user \'{}\' in folder \'{}\''.format(itemcount, user.name.decode('utf-8'), folder.name.decode('utf-8'))) File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 3: ordinal not in range(128)
I understand the problem that my wastebasket is called “Gelöschte Objekte” and thats a umlaut, but iam not really familiar with python code.
Do you have a chance to change something there?
Thanks in advance
-
@BMWfan hmm, that is not really my expertise - I will ask around.
-
@bhuisman could you find someone who is familiar with it?
-
@BMWfan the version on https://stash.kopano.io/projects/KSC/repos/core-tools/browse/kopano-cleanup/kopano-cleanup.py should fix this issue now
-
hi,
which version of python is required?./kopano-cleanup.py --user ***–junk --wastebaket --days 30
./kopano-cleanup.py: Zeile 1: Syntaxfehler beim unerwarteten Wort »<«
./kopano-cleanup.py: Zeile 1: `<!DOCTYPE html><html lang=“en”><head><meta charset=“utf-8”><meta http-equiv=“X-UA-Compatible” content=“IE=edge”><title>Source of kopano-cleanup.py - Core-tools - Bitbucket</title><script>’Doesn’t matter if python 2.7, 3 opder 3.6 is used.
best regards -
For your file you need a browser as you downloaded the html page.
In stash/bitbucket you need to press the ‘Raw file’ button first to download directly from there
This link will give you the python file
https://stash.kopano.io/projects/KSC/repos/core-tools/raw/kopano-cleanup/kopano-cleanup.pyIt shouldn’t matter if you use python 2 or 3
-
-
@robing thanks but for me is it not working:
python kopano-cleanup.py --user Daniel --wastebasket --days=10 Running script for 'Daniel' Traceback (most recent call last): File "kopano-cleanup.py", line 126, in <module> main() File "kopano-cleanup.py", line 112, in main deleteitems(options, user, folder) File "kopano-cleanup.py", line 93, in deleteitems print('Deleted {} item(s) for user \'{}\' in folder \'{}\''.format(itemcount, _encode(user.name), _encode(folder.name))) File "kopano-cleanup.py", line 16, in _encode return s.encode(sys.stdout.encoding or 'utf8') UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 3: ordinal not in range(128)
-
@BMWfan it seems that your terminal does not support utf-8 characters.
-
@fbartels thank you for your fast reply.
Could you tell me how could i solve that? Its a debian 9 operating system. -
The OS from where you are connecting is Debian 9? Or is the OS of the server Debian 9?
-
@fbartels the OS from where i connecting is Windows 10. The OS on which i connecting is Debian 9.
-
@BMWfan and what terminal/client are you using to connect? Like I said it seems this terminal does not seem to support utf-8.
-
@fbartels its Putty with this Window Translation Setting:
-
-
@fbartels thanks, this explanations from your provided link helped me.
Thatswhy i started the script in the Backgroundpython kopano-cleanup.py --user Daniel --wastebasket --days=0 &
and get this output:Deleted 3 item(s) for user 'Daniel' in folder 'Gelöschte Objekte'
The items are also really removed.