Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] clips to backup file

Expand Messages
  • Larry Thomas
    Hi Charles, ... Try: ^!Save As ^#^$GetDate(yyyymmnn).bak This should give you a file with the backup name: filename.txt -- filename20040709.bak Regards, Larry
    Message 1 of 11 , Jul 9, 2004
    • 0 Attachment
      Hi Charles,

      At 02:13 PM 7/9/04 -0000, you wrote:
      >I am looking for a clip that will backup a text file and append the
      >current date:
      >
      > filename.txt --> filename20040709.txt.bak
      >
      >Has something like that been written in one of the clip collections on
      >the fookes website?

      Try:

      ^!Save As ^#^$GetDate(yyyymmnn).bak

      This should give you a file with the backup name:

      filename.txt --> filename20040709.bak

      Regards,

      Larry
      lrt@... e¿ê
    • Lee Underwood
      Larry, I think you need to add the last $ and dd, i.e. ^!Save AS ^#^$GetDate(yyyymmdd)$.txt Lee
      Message 2 of 11 , Jul 9, 2004
      • 0 Attachment
        Larry,

        I think you need to add the last "$" and dd, i.e.

        ^!Save AS ^#^$GetDate(yyyymmdd)$.txt


        Lee


        At 7/9/04 04:58 PM, Larry Thomas wrote:

        >Hi Charles,
        >
        >At 02:13 PM 7/9/04 -0000, you wrote:
        > >I am looking for a clip that will backup a text file and append the
        > >current date:
        > >
        > > filename.txt --> filename20040709.txt.bak
        > >
        > >Has something like that been written in one of the clip collections on
        > >the fookes website?
        >
        >Try:
        >
        >^!Save As ^#^$GetDate(yyyymmnn).bak
        >
        >This should give you a file with the backup name:
        >
        >filename.txt --> filename20040709.bak
        >
        >Regards,
        >
        >Larry
        >lrt@... e¿ê
        >
        >
        >
        >
        >
        >Yahoo! Groups Links
        >
        >
        >
        >
      • charlesgran
        ... Right, I see how this works. Could CopyFile or Export be used so that I can keep the original document up for editing? I d like to be able to backup on
        Message 3 of 11 , Jul 9, 2004
        • 0 Attachment
          --- In ntb-clips@yahoogroups.com, Lee Underwood <leeu@c...> wrote:
          > Larry,
          >
          > I think you need to add the last "$" and dd, i.e.
          >
          > ^!Save AS ^#^$GetDate(yyyymmdd)$.txt

          Right, I see how this works. Could CopyFile or Export be used so that
          I can keep the original document up for editing? I'd like to be able
          to backup on the fly as I edit, so I can preserve data before a
          change. I don't understand what "filespecs" for CopyFile (^!CopyFile
          "FileSpecs" "Destination") means.
        • melchior prisi
          Hi, ... Try this one: H= BACKUP ^!save ^!texttofile ^#^$getdate(yyyymmdd)$.txt ^$getfiletext(^##)$ This will save your document and leave it open while
          Message 4 of 11 , Jul 9, 2004
          • 0 Attachment
            Hi,

            ----- on 10.07.2004 02:20 charlesgran wrote:
            > Right, I see how this works. Could CopyFile or Export be used so that
            > I can keep the original document up for editing? I'd like to be able
            > to backup on the fly as I edit, so I can preserve data before a
            > change.

            Try this one:

            H="BACKUP"
            ^!save
            ^!texttofile "^#^$getdate(yyyymmdd)$.txt" ^$getfiletext(^##)$

            This will save your document and leave it open
            while writing its content to the backup file.

            If you want to make more than one different backup file
            a day you can use ^$getdate(yyymmddhhnn)$ where hh = hours
            and nn = minutes (ss would be seconds..).



            Regards,
            Melchior




            --
            http://loc.alphazwirbel.net
            http://orp.alphazwirbel.net
          • Larry Thomas
            ... Melchior s clip is ok but it give you a .txt extension and you want a .bak extension. It also replaces all of your backups everytime you make a new
            Message 5 of 11 , Jul 9, 2004
            • 0 Attachment
              At 02:48 AM 7/10/04 +0200, you wrote:
              >Hi,
              >
              >----- on 10.07.2004 02:20 charlesgran wrote:
              >> Right, I see how this works. Could CopyFile or Export be used so that
              >> I can keep the original document up for editing? I'd like to be able
              >> to backup on the fly as I edit, so I can preserve data before a
              >> change.
              >
              >Try this one:
              >
              >H="BACKUP"
              >^!save
              >^!texttofile "^#^$getdate(yyyymmdd)$.txt" ^$getfiletext(^##)$
              >
              >This will save your document and leave it open
              >while writing its content to the backup file.

              Melchior's clip is ok but it give you a .txt extension and you want a .bak
              extension. It also replaces all of your backups everytime you make a new
              backup. The clip below will make a backup with an extensio of .bak and it
              will give each backup a sequence number so that the next one does not
              replace the previous one. You will end up with a series of backups such as:

              filename20040709.bak
              filename20040709-01.bak
              filename20040709-02.bak
              filename20040709-03.bak
              filename20040709-04.bak

              filename20040709-99.bak
              filename20040709-100.bak
              filename20040709-101.bak

              Which is what I think that you want. Just place this on a button on your
              clipbar.

              ______[Copy below this line]_______
              H="BACKUP"
              ;lrt@... e¿ê
              ;07/09/2004, 08:29:06 PM
              ^!save
              ^!Set %IDX%=1
              :Loop
              ^!If ^%IDX% > 9 Skip
              ^!Set %IDX%=^$StrcopyRight("0^%IDX%";2)$
              ^!IfFileExists "^#^$Getdate(yyyymmdd)$-^%IDX%.bak Next ELSE Skip_2
              ^!Inc %IDX%
              ^!Goto Loop
              ^!texttofile "^#^$getdate(yyyymmdd)$-^%IDX%.bak" ^$getfiletext(^##)$
              _____[Copy above this line]______
              | right click over the clipbook |
              | and choose "Add from Clipboard" |
              ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

              Regards,

              Larry
              lrt@... e¿ê
            • Larry Thomas
              Sorry but in my previous post I made a mistake in the coding which would have caused the variable %IDX% to fail to increment properly. I change the clip as
              Message 6 of 11 , Jul 9, 2004
              • 0 Attachment
                Sorry but in my previous post I made a mistake in the coding which would
                have caused the variable %IDX% to fail to increment properly. I change the
                clip as below and it now should work correctly.

                ______[Copy below this line]_______
                H="BACKUP"
                ;lrt@... e¿ê
                ;07/09/2004, 08:47:59 PM
                ^!save
                ^!Set %IDX%=1
                :Loop
                ^!If ^%IDX% > 9 Skip_2
                ^!Set %Sequence%=0^%IDX%
                ^!Goto Skip
                ^!Set %Sequence%=^%IDX%
                ^!IfFileExists "^#^$Getdate(yyyymmdd)$-^%Sequence%.bak Next ELSE Skip_2
                ^!Inc %IDX%
                ^!Goto Loop
                ^!texttofile "^#^$getdate(yyyymmdd)$-^%Sequence%.bak" ^$getfiletext(^##)$
                _____[Copy above this line]______
                | right click over the clipbook |
                | and choose "Add from Clipboard" |
                ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

                Regards,

                Larry
                lrt@... e¿ê
              • charlesgran
                ... And this works as a nice substitute for incremental numbering as Larry does it (and which I think is nice as well).
                Message 7 of 11 , Jul 9, 2004
                • 0 Attachment
                  --- In ntb-clips@yahoogroups.com, melchior prisi <mprisi@s...> wrote:

                  > If you want to make more than one different backup file
                  > a day you can use ^$getdate(yyymmddhhnn)$ where hh = hours
                  > and nn = minutes (ss would be seconds..).

                  And this works as a nice substitute for incremental numbering as Larry
                  does it (and which I think is nice as well).
                • charlesgran
                  ... I get an error message with this for this line.
                  Message 8 of 11 , Jul 9, 2004
                  • 0 Attachment
                    > ^!IfFileExists "^#^$Getdate(yyyymmdd)$-^%Sequence%.bak Next ELSE Skip_2

                    I get an error message with this for this line.
                  • Larry Thomas
                    hI, ... Sorry, the file name is missing a double quote after the .bak extension. This is the corrected line: ^!IfFileExists
                    Message 9 of 11 , Jul 9, 2004
                    • 0 Attachment
                      hI,

                      At 02:30 AM 7/10/04 -0000, you wrote:
                      >> ^!IfFileExists "^#^$Getdate(yyyymmdd)$-^%Sequence%.bak Next ELSE Skip_2
                      >
                      >I get an error message with this for this line.

                      Sorry, the file name is missing a double quote after the .bak extension.

                      This is the corrected line:

                      ^!IfFileExists "^#^$Getdate(yyyymmdd)$-^%Sequence%.bak" Next ELSE Skip_2

                      Regards,

                      Larry
                      lrt@... e¿ê
                    • Larry Thomas
                      Hi Charles, ... This is a message to myself followed by a correction for you. Dear Larry Thomas, PLEASE, PLEASE, TEST ALL CLIPS BEFORE YOU POST THEM. EVERY
                      Message 10 of 11 , Jul 9, 2004
                      • 0 Attachment
                        Hi Charles,

                        At 09:59 PM 7/9/04 -0500, I previously wrote:
                        >
                        >hI,
                        >
                        >At 02:30 AM 7/10/04 -0000, you wrote:
                        >>> ^!IfFileExists "^#^$Getdate(yyyymmdd)$-^%Sequence%.bak Next ELSE Skip_2
                        >>
                        >>I get an error message with this for this line.
                        >
                        >Sorry, the file name is missing a double quote after the .bak extension.
                        >
                        >This is the corrected line:
                        >
                        > ^!IfFileExists "^#^$Getdate(yyyymmdd)$-^%Sequence%.bak" Next ELSE Skip_2

                        This is a message to myself followed by a correction for you.

                        Dear Larry Thomas,

                        PLEASE, PLEASE, TEST ALL CLIPS BEFORE YOU POST THEM. EVERY TIME YOU DON'T
                        YOU END UP POSTING A BUNCH OF STUPID MISTAKES AND HAVING TO POST AND REPOST
                        MANY MANY CORRECTIONS.

                        Uhmmm thank you, that is all.

                        To Charles,

                        I tested the clip and it still did not work even with the double quote
                        added to the line above. Then I see that I used an s at the end of
                        IfFileExist which of coarse, NoteTab's clip parser refused to recognize so
                        I took the s off and it now works just fine.

                        Sorry,

                        Regards,

                        Larry
                        lrt@... e¿ê
                      • charlesgran
                        ... Wow--thanks for all the work, I appreciate it!
                        Message 11 of 11 , Jul 10, 2004
                        • 0 Attachment
                          --- In ntb-clips@yahoogroups.com, Larry Thomas <larryt@c...> wrote:

                          > I took the s off and it now works just fine.

                          Wow--thanks for all the work, I appreciate it!
                        Your message has been successfully submitted and would be delivered to recipients shortly.