UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Script to clean Teleports without logging out

    Scheduled Pinned Locked Moved App Development
    4 Posts 2 Posters 287 Views 2 Watching
    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.
      • BollyB Offline
        Bolly
        last edited by Bolly

        This time I have made a script to delete files from Teleports as their folders/files take up a lot of space. I always used to do it with UT Tweak Tool but the drawback is that you have to reconfigure the Telegram account.

        CleanTeleports.sh

        First, use the Morph browser or Teleports to download (just click) CleanTeleports.sh from here or create a file with the following code:

        #!/bin/bash
         
        du -hd 0 ~/.local/share/teleports.ubports/teleports.ubports/files/
        du -hd 0 ~/.local/share/teleports.ubports/teleports.ubports/database/thumbnails/
        du -hd 0 ~/.local/share/teleports.ubports/teleports.ubports/database/profile_photos/
        du -hd 0 ~/.local/share/teleports.ubports/teleports.ubports/database/db.sqlite
        read -p "Please close the Teleports application, is it closed? y/N " answer
        if [ "$answer" == "y" ] || [ "$answer" == "Y" ] ; then
            seconds=10; date1=$((`date +%s` + $seconds)); 
            while [ "$date1" -gt `date +%s` ]; do
                echo -ne "The files will be deleted within $(date -u --date @$(($date1 - `date +%s` )) +%s) seconds..\r"; 
            done
            sleep 1; echo -e "\nDeleting..."
            rm -rv ~/.local/share/teleports.ubports/teleports.ubports/files
            rm -rv ~/.local/share/teleports.ubports/teleports.ubports/database/thumbnails/
            rm -rv ~/.local/share/teleports.ubports/teleports.ubports/database/profile_photos/
            rm -v ~/.local/share/teleports.ubports/teleports.ubports/database/db.sqlite
            du -hd 0 ~/.local/share/teleports.ubports/teleports.ubports/files/
            du -hd 0 ~/.local/share/teleports.ubports/teleports.ubports/database/thumbnails/
            du -hd 0 ~/.local/share/teleports.ubports/teleports.ubports/database/profile_photos/
            du -hd 0 ~/.local/share/teleports.ubports/teleports.ubports/database/db.sqlite
            else
            echo "Script cancelled, it is necessary to manually close the Teleports application."
        fi
        

        Now we have to give run permissions to the CleanTeleports.sh file and run it, I assume it is in the Downloads folder. Open the terminal and run the following:

        cd Downloads
        chmod +x CleanTeleports.sh
        ./CleanTeleports.sh
        

        It then tells us the size of the folders and the db.sqlite database.

        If we want to delete these folders and the database, we will have to close Teleports if it is not already closed and tell it that we have already closed it by typing "y" and enter. If we don't want to clean up, we press anything other than "y" or "Y" or close the terminal.

        alt text

        I hope you find it as useful as I do, as I still use Krillin on a daily basis and he has always been the "little guy in the house", little space 😂.

        Caution: Please note that running this script will delete some Teleports files and it might take a while to start up the first time because of this as they will be created again.

        In Spanish -> https://elcondonrotodegnu.wordpress.com/2024/03/31/limpiar-teleports-sin-cerrar-sesion/

        2015-Now (Daily use) : BQ Aquaris E4.5 Ubuntu edition
        2016-Now (Daily use) : BQ Aquaris M10 FHD Betatester

        2020-Now : PinePhone Braveheart & CE UBports
        2020-Now (Family/Daily use): Vollaphone Xenial
        2022-Now (Family/Daily use): Vollaphone 22 Focal

        1 Reply Last reply Reply Quote 3
        • K Offline
          kugiigi
          last edited by

          I actually recently checked for duplicate files in my Nextcloud server and found thousands of teleports images since I have a few backup of its app data 😆 And those were just images! (thumbnails, profile pic, cache, etc)

          BollyB 1 Reply Last reply Reply Quote 1
          • BollyB Offline
            Bolly @kugiigi
            last edited by

            @kugiigi You may have to exclude some folders or all Teleports from the backup. 😂

            2015-Now (Daily use) : BQ Aquaris E4.5 Ubuntu edition
            2016-Now (Daily use) : BQ Aquaris M10 FHD Betatester

            2020-Now : PinePhone Braveheart & CE UBports
            2020-Now (Family/Daily use): Vollaphone Xenial
            2022-Now (Family/Daily use): Vollaphone 22 Focal

            K 1 Reply Last reply Reply Quote 0
            • K Offline
              kugiigi @Bolly
              last edited by

              @Bolly I actually stopped backing up teleports. It doesn't make sense anyway since all data are in the cloud. They were just old backups I did years ago. I think I included everything in the app data folder 😅

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