Announcement

Collapse
No announcement yet.

Backup file generated, why?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Backup file generated, why?

    Every time I create a new text document I end up with the original file and an additional file with the same name but with what appears to be the green re-cycle logo, Dolpin reports this to be 'type: backup file.'

    I have no idea why this is happening as I'm a recent convert from Ubuntu and have never experienced this before.

    Does anyone have any ideas?

    Kubuntu 15.10

    #2
    Re: Backup file generated, why?

    It's a configuration option in Kate. You can turn it off under the Kate options open/save->advanced->"Backup on Save". Uncheck the "Local Files" and "Remote Files" check boxes.

    The consequences of doing so is you won't have backups of files as you save them.

    Comment


      #3
      Re: Backup file generated, why?

      Thanks, i shall be disabling that, it was really bugging me to the point that i didn't want to create any documents.

      Any important files, of which there aren't many, i have either backed up on my external hard drive or via dropbox.

      Saying that is there a way of changing the location that the backup file is created?
      If it could be saved in my dropbox folder instead of the same location as the original then that may be more useful.
      Kubuntu 15.10

      Comment


        #4
        Re: Backup file generated, why?

        How about a script that moves all your kate backups to your dropbox folder?

        Could be executed at login, logout or via a cron job...

        Please Read Me

        Comment


          #5
          Re: Backup file generated, why?

          I'm new to kubuntu and not to familiar with scripts, as you have probably noticed due to the fact that you have replied to one of my other posts to

          How would that work exactly?
          Could the script just move all the backup files and leave the originals in place?
          Kubuntu 15.10

          Comment


            #6
            Re: Backup file generated, why?

            Kate just renames the original file by adding a character to the filename. It would be simple enough to search the hard drive for these files and move them. I'm at work right now, but I'll play around with it later.

            Please Read Me

            Comment


              #7
              Re: Backup file generated, why?

              Thanks for your help, it's greatly appreciated.

              I am very impressed with the level of help and guidance that people on this forum provide, it is one of the things that has made the move from Ubuntu to Kubuntu enjoyable.

              I look forward to seeing what you come up with.
              Kubuntu 15.10

              Comment


                #8
                Re: Backup file generated, why?

                Yeah, its a great forum for the most part.

                Actually, the idea of automatically storing those backup files good be useful.

                I do find sometimes though that seeing the backup sitting there in /etc/ helps trigger my memory that I edited something.

                Please Read Me

                Comment


                  #9
                  Re: Backup file generated, why?

                  Ok, so this command does what I think you want...

                  locate *~ |xargs tar czvf backupfiles.tar --remove-files


                  This lists all the files that end with ~ (the character the kate puts at the end of a backup file), packs them in a tar file along with their original paths (so you know where they came from), and deletes them. The script this command is in would have to have sudo access or you'd be putting in a password to get it to work.

                  The danger would be if for some reason some other program put a ~ at the end of some file, it too would be moved to the archive. On the plus side, any file you added the ~ to would get moved away automatically. Kind of like an automatic file removal and storage.

                  My problem is - I don't know tar well enough to know what it will do when it encounters a duplicate filename. For example, you edit your .bashrc file, then the backup is moved away at some point, a week later you change your .bashrc again - does tar replace the .bashrc~ file the the new one or store both of them or keep the previous version and ignore the new one or just put out an error message and quit? The behavior of kate would be to keep only the latest backup, so if tar replaces the older backup with the new one that is the functional equivalent.

                  One could create a script to create a daily tar that was then put into another tar, sort of a rolling daily backup. I doubt it would ever get too large because we're talking about a really small number of very small files.

                  Please Read Me

                  Comment


                    #10
                    Re: Backup file generated, why?

                    Originally posted by oshunluvr
                    locate *~
                    That probably doesn't do what is expected
                    EDIT: I'll take that back a bit, whether it works depends on the shell (or globbing options), seems to work ok in bash
                    Code:
                    locate --regex ~$
                    Should work universally.

                    However, there are still a good number of question marks and failure points (especially if automated) in this approach (which makes me think it's probably not a good idea). Here's a couple that come to mind (along with the problems you mentioned):

                    1. locate database can be out of date (it is updated daily via cron), to get a n up-to-date list one would have to either use find or run updatedb (as root) prior to using locate
                    2. it only backs up files that end in ~ (and only the latest edit, if you save numerous times), it's a lot better to create regular backups of all your data.

                    EDIT:
                    If one really wishes to do that, one could change kate file backups (in kate settings) to be saved as: file --> .file.kate.bu~
                    That would make the ~ files hidden in normal view (dot-files) and also easier to identify with locate and find (ending with ".kate.bu~")

                    Comment


                      #11
                      Re: Backup file generated, why?

                      One caveat, though.

                      locate has required you to be root ever since Jaunty. I bugged it back then and their answer makes sense - that locate would give you information on files you may not have permission to access. mlocate works for all users, though -

                      https://bugs.launchpad.net/ubuntu/+s...te/+bug/367313

                      we see things not as they are, but as we are.
                      -- anais nin

                      Comment


                        #12
                        Re: Backup file generated, why?

                        Originally posted by wizard10000
                        One caveat, though.

                        locate has required you to be root ever since Jaunty. I bugged it back then and their answer makes sense - that locate would give you information on files you may not have permission to access. mlocate works for all users, though -

                        https://bugs.launchpad.net/ubuntu/+s...te/+bug/367313
                        By default, "locate" is actually a symlink to "mlocate" (through /etc/alternatives/locate).

                        Comment


                          #13
                          Re: Backup file generated, why?

                          Originally posted by kubicle
                          By default, "locate" is actually a symlink to "mlocate" (through /etc/alternatives/locate).
                          I didn't know that. I've been doing 'sudo locate' for a couple years now

                          Thanks, kubicle
                          we see things not as they are, but as we are.
                          -- anais nin

                          Comment


                            #14
                            Re: Backup file generated, why?

                            But, mlocate, just like locate, when executed without sudo, will not find files that the non-sudoed user is not allowed to access. I just tried.
                            Windows no longer obstructs my view.
                            Using Kubuntu Linux since March 23, 2007.
                            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                            Comment


                              #15
                              Re: Backup file generated, why?

                              Originally posted by Snowhog
                              But, mlocate, just like locate, when executed without sudo, will not find files that the non-sudoed user is not allowed to access. I just tried.
                              True, but you probably don't wish to mess with files you have no access to, at least in this case (automatic backup and removal)...and if you do, you would probably have to run the script as root anyway (as updatedb, tarring and removing would need root access as well)

                              Comment

                              Working...
                              X