How to configure backups to get the backup file saved with relative path to saved file?

How to configure backups to get the backup file saved with relative path to saved file?

2
NewbieNewbie
2

    Aug 19, 2019#1

    I have been trying to set the path of backups in UltraEdit to a path relative to the path containing the edited file, but can't see how to accomplish this. So if I am editing the file C:\TEST\A.SQL, I want the backups to go to C:\TEST\BACKUPS\A.SQL.BAK and C:\OTHER_FOLDER\A.SQL would go to C:\OTHER_FOLDER\BACKUPS\A.SQL.BAK. Ideally the BACKUPS folder would be automatically created, but if I have to create it, that's okay, too.

    I've tried setting the default backup folder in setting to variations of "backups", "backups\" and ".\backups" to no avail.

    6,603548
    Grand MasterGrand Master
    6,603548

      Aug 20, 2019#2

      The Microsoft article Naming Files, Paths, and Namespaces explains relative paths as managed by Windows file systems.

      A file/folder name starting with .\ or directly with a file/folder name is relative to current directory of the running process. For that reason a backup directory specification with backups, backups\ or .\backups results in creating the backup files in a subdirectory backups in current directory of UltraEdit.

      What is the current directory for running UltraEdit instance can be seen for example on running from within UltraEdit the DOS Command (not good name as in real a Windows CMD command can be executed only nowadays) dir with leaving Working directory empty in Dos Command dialog window. UltraEdit creates the directory tree to backup directory automatically if necessary.

      However, the backup concept you want with saving a file in a subfolder backups of current folder of saved file can be achieved with following settings at Advanced - Settings or Configuration - File handling - Backup:
      1. No backup is selected for Backup files on save.
      2. Default backup directory is empty because of not used at all.
      3. Version backup is enabled by checking On save and using for Format the string backups\$n$e.bak and 1 is set for Maximum number of backups.
      A file to save is copied first with these backup settings with .bak appended to file name into subfolder backups of the folder containing the file created automatically by UltraEdit if not already existing and then the modified file is saved in its folder.

      UltraEdit saves version backups as well as normal backups by default in folder of file to save while the Default backup directory is interpreted as absolute folder path and in case of being a relative path because of user has entered a relative folder path, UltraEdit left it over the operating system respectively the file system where the backup folder is located.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Aug 20, 2019#3

        Worked perfectly.  Thanks very much!