Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    Kopano cleanup not functioning

    Kopano Groupware Core
    5
    19
    966
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bhuisman
      bhuisman last edited by

      @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…

      Regards, Bob

      Need support?
      Have a look at https://kopano.com/support/ for options.

      Helpful resources:
      https://kopano.com/blog/how-to-get-kopano/
      https://documentation.kopano.io/
      https://kb.kopano.io/

      BMWfan 1 Reply Last reply Reply Quote 0
      • BMWfan
        BMWfan @bhuisman last edited by

        @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

        1 Reply Last reply Reply Quote 0
        • bhuisman
          bhuisman last edited by

          @BMWfan hmm, that is not really my expertise - I will ask around.

          Regards, Bob

          Need support?
          Have a look at https://kopano.com/support/ for options.

          Helpful resources:
          https://kopano.com/blog/how-to-get-kopano/
          https://documentation.kopano.io/
          https://kb.kopano.io/

          BMWfan 1 Reply Last reply Reply Quote 0
          • BMWfan
            BMWfan @bhuisman last edited by

            @bhuisman could you find someone who is familiar with it?

            1 Reply Last reply Reply Quote 0
            • robing
              robing Kopano (Inactive) last edited by

              @BMWfan the version on https://stash.kopano.io/projects/KSC/repos/core-tools/browse/kopano-cleanup/kopano-cleanup.py should fix this issue now

              Regards Robin,

              Need support?
              Have a look at https://kopano.com/support/ for options.

              Helpful resources:
              https://kopano.com/blog/how-to-get-kopano/
              https://documentation.kopano.io/
              https://kb.kopano.io/

              BMWfan 1 Reply Last reply Reply Quote 0
              • AnotherAndy
                AnotherAndy last edited by

                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

                1 Reply Last reply Reply Quote 1
                • robing
                  robing Kopano (Inactive) last edited by

                  @AnotherAndy

                  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.py

                  It shouldn’t matter if you use python 2 or 3

                  Regards Robin,

                  Need support?
                  Have a look at https://kopano.com/support/ for options.

                  Helpful resources:
                  https://kopano.com/blog/how-to-get-kopano/
                  https://documentation.kopano.io/
                  https://kb.kopano.io/

                  1 Reply Last reply Reply Quote 0
                  • AnotherAndy
                    AnotherAndy last edited by

                    hi @robing ,
                    thanks, now it looks good.

                    python ./kopano-cleanup.py --user –wastebasket --days 30
                    Running script for '
                    ’
                    Deleted 5 item(s) for user ‘****’ in folder ‘Gelöschte Objekte’

                    I think no @BMWfan can also test it.
                    best regards

                    1 Reply Last reply Reply Quote 1
                    • BMWfan
                      BMWfan @robing last edited by BMWfan

                      @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)
                      
                      fbartels 1 Reply Last reply Reply Quote 0
                      • fbartels
                        fbartels Kopano @BMWfan last edited by

                        @BMWfan it seems that your terminal does not support utf-8 characters.

                        Regards Felix

                        Resources:
                        https://kopano.com/blog/how-to-get-kopano/
                        https://documentation.kopano.io/
                        https://kb.kopano.io/

                        Support overview:
                        https://kopano.com/support/

                        BMWfan 1 Reply Last reply Reply Quote 0
                        • BMWfan
                          BMWfan @fbartels last edited by

                          @fbartels thank you for your fast reply.
                          Could you tell me how could i solve that? Its a debian 9 operating system.

                          1 Reply Last reply Reply Quote 0
                          • fbartels
                            fbartels Kopano last edited by

                            The OS from where you are connecting is Debian 9? Or is the OS of the server Debian 9?

                            Regards Felix

                            Resources:
                            https://kopano.com/blog/how-to-get-kopano/
                            https://documentation.kopano.io/
                            https://kb.kopano.io/

                            Support overview:
                            https://kopano.com/support/

                            BMWfan 1 Reply Last reply Reply Quote 0
                            • BMWfan
                              BMWfan @fbartels last edited by

                              @fbartels the OS from where i connecting is Windows 10. The OS on which i connecting is Debian 9.

                              fbartels 1 Reply Last reply Reply Quote 0
                              • fbartels
                                fbartels Kopano @BMWfan last edited by

                                @BMWfan and what terminal/client are you using to connect? Like I said it seems this terminal does not seem to support utf-8.

                                Regards Felix

                                Resources:
                                https://kopano.com/blog/how-to-get-kopano/
                                https://documentation.kopano.io/
                                https://kb.kopano.io/

                                Support overview:
                                https://kopano.com/support/

                                BMWfan 1 Reply Last reply Reply Quote 0
                                • BMWfan
                                  BMWfan @fbartels last edited by BMWfan

                                  @fbartels its Putty with this Window Translation Setting:
                                  alt text

                                  fbartels 1 Reply Last reply Reply Quote 0
                                  • fbartels
                                    fbartels Kopano @BMWfan last edited by

                                    @BMWfan the this will help https://stackoverflow.com/questions/32826624/unicodeencodeerror-ascii-codec-cant-encode-characters-ordinal-not-in-range1?rq=1

                                    Regards Felix

                                    Resources:
                                    https://kopano.com/blog/how-to-get-kopano/
                                    https://documentation.kopano.io/
                                    https://kb.kopano.io/

                                    Support overview:
                                    https://kopano.com/support/

                                    BMWfan 1 Reply Last reply Reply Quote 0
                                    • BMWfan
                                      BMWfan @fbartels last edited by

                                      @fbartels thanks, this explanations from your provided link helped me.
                                      Thatswhy i started the script in the Background python 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.

                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post