General Programming Question: Making Backups 
Author Message
 General Programming Question: Making Backups

I use Rexx and Info-Zip to back up certain files when I change them.
(They're INI files and other settings and stuff for a program.) As it
is, I create a filename out of the current date with Date(S) and have
Info-Zip read a list of files and zip them into an archive with that
name. It works just fine, one of those things that doesn't have much of
a chance to go awry. Not many "moving parts", so to speak.

It occurs to me now that I'd like a way of keeping only the three most
recent backups. I could go in and delete them from a command line,
sure, but only if I remember to do it.

This would be easy with RexxUtil but I'd prefer to use plain Rexx. I'll
appreciate any suggestions. Thanks.

--
Michael DeBusk, Co-Conspirator to Make the World a Better Place
Did he update http://www.*-*-*.com/ ~debu4335/ yet?



Tue, 25 Oct 2005 13:13:58 GMT  
 General Programming Question: Making Backups


Quote:
> I use Rexx and Info-Zip to back up certain files when I change
> them. (They're INI files and other settings and stuff for a
> program.) As it is, I create a filename out of the current date
> with Date(S) and have Info-Zip read a list of files and zip them
> into an archive with that name. It works just fine, one of those
> things that doesn't have much of a chance to go awry. Not many
> "moving parts", so to speak.

> It occurs to me now that I'd like a way of keeping only the three
> most recent backups. I could go in and delete them from a command
> line, sure, but only if I remember to do it.

> This would be easy with RexxUtil but I'd prefer to use plain Rexx.
> I'll appreciate any suggestions. Thanks.

Which REXX and platorm?  Are all files in one directory by themselves?  
Must they be deleted based on the actual filename "date" or by
filesystem date?


Tue, 25 Oct 2005 16:42:22 GMT  
 General Programming Question: Making Backups

Quote:

>I use Rexx and Info-Zip to back up certain files when I change them.
>(They're INI files and other settings and stuff for a program.) As it
>is, I create a filename out of the current date with Date(S) and have
>Info-Zip read a list of files and zip them into an archive with that
>name. It works just fine, one of those things that doesn't have much of
>a chance to go awry. Not many "moving parts", so to speak.

>It occurs to me now that I'd like a way of keeping only the three most
>recent backups. I could go in and delete them from a command line,
>sure, but only if I remember to do it.

>This would be easy with RexxUtil but I'd prefer to use plain Rexx. I'll
>appreciate any suggestions. Thanks.

Without SysFileTree, you'd have to know the names of the files you're looking
for, and test the existence of each one.

--
 - Mike

Remove 'spambegone.net' and reverse to send e-mail.



Tue, 25 Oct 2005 20:20:39 GMT  
 General Programming Question: Making Backups

Quote:


<snip>

> Without SysFileTree, you'd have to know the names of the files you're looking
> for, and test the existence of each one.

> --
>  - Mike

> Remove 'spambegone.net' and reverse to send e-mail.

cmd = 'dir /od' /* or ls -ltar */

od = directory(theDir)
do while queued() <> 0
        parse value linein("QUEUE:") with l1 l2 l3 l4 l5 . /* depending on os */
        ...

Wolfgang



Tue, 25 Oct 2005 21:32:58 GMT  
 General Programming Question: Making Backups
hi

Quote:

----- snip

 > cmd = 'dir /od' /* or ls -ltar */
Quote:
> ...

> od = directory(theDir)
> do while queued() <> 0
>         parse value linein("QUEUE:") with l1 l2 l3 l4 l5 . /* depending on os */
>         ...


--
good luck

peter



Tue, 25 Oct 2005 22:17:07 GMT  
 General Programming Question: Making Backups


Quote:


> <snip>

>> Without SysFileTree, you'd have to know the names of the files
>> you're looking for, and test the existence of each one.

>> --
>>  - Mike

>> Remove 'spambegone.net' and reverse to send e-mail.

> cmd = 'dir /od' /* or ls -ltar */
> ...

> od = directory(theDir)
> do while queued() <> 0
>      parse value linein("QUEUE:") with l1 l2 l3 l4 l5 . /*
>      depending on os */ ...

My thoughts along similar lines
 ADDRESS SYSTEM 'DIR directory\* /od /b /a-d >LIFO'
skip 3 from queue then delete remaining
(W2K, Regina)


Tue, 25 Oct 2005 22:57:30 GMT  
 General Programming Question: Making Backups

Quote:

>  Which REXX and platorm?

I am using standard Rexx on OS/2. I don't want it to be OS/2-specific,
though, which is why I wanted to avoid RexxUtil.

Quote:
>  Are all files in one directory by themselves?

No, but I could do that if it would make things easier.

Quote:
>  Must they be deleted based on the actual filename "date" or by
>  filesystem date?

Well... since the filename is taken from the system date, the only time
they'd be different is if I ran the script at, say, 23:59:59:50.

The only reason I chose the date as the filename was to create a unique
filename with a predictable format that didn't require a call to
RexxUtil and that would be easy to sort. I could have used fixed
filenames (BACKUP01.ZIP, BACKUP02.ZIP, BACKUP03.ZIP) and I may still do
that if it would prove to be easier. Looks like it so far.

--
Michael DeBusk, Co-Conspirator to Make the World a Better Place
Did he update http://home.earthlink.net/~debu4335/ yet?



Wed, 26 Oct 2005 15:30:47 GMT  
 General Programming Question: Making Backups
On Fri, 09 May 2003 12:20:39 GMT, Mike Ruskai

Quote:

>  Without SysFileTree, you'd have to know the names of the files
>  you're looking for, and test the existence of each one.

I was thinking that is the case, and was hoping someone would prove me
wrong. I'll likely end up using fixed filenames.

--
Michael DeBusk, Co-Conspirator to Make the World a Better Place
Did he update http://home.earthlink.net/~debu4335/ yet?



Wed, 26 Oct 2005 15:31:56 GMT  
 General Programming Question: Making Backups
On Fri, 09 May 2003 15:32:58 +0200, Wolfgang Riedel

Quote:

>  cmd = 'dir /od' /* or ls -ltar */

Hmmm... I could do 'dir/b/o:d ????????.zip' (not sure how that works
with the "ls" command) and then test each filename to make sure it's
numeric (there's currently in that directory a zipfile with an
eight-character filename that's all alpha, but not for long). If I have
more than three, then strip off the extensions, put all the filenames
in a comma-separated string, and use the MIN() function on it.

Sounds complicated but do-able. Seems a lot easier to use fixed
filenames. I'll play with it, though. Thank you. :)

--
Michael DeBusk, Co-Conspirator to Make the World a Better Place
Did he update http://home.earthlink.net/~debu4335/ yet?



Wed, 26 Oct 2005 15:51:07 GMT  
 General Programming Question: Making Backups

Quote:

>  skip 3 from queue then delete remaining

This is looking good to me. Much better than what I had in mind with
the MIN() function. I tend to make things too complicated...

Thank you.

--
Michael DeBusk, Co-Conspirator to Make the World a Better Place
Did he update http://home.earthlink.net/~debu4335/ yet?



Wed, 26 Oct 2005 15:58:01 GMT  
 General Programming Question: Making Backups


Quote:


>>  skip 3 from queue then delete remaining

> This is looking good to me. Much better than what I had in mind
> with the MIN() function. I tend to make things too complicated...

Well it leverages the OS's dir by date and does not require an external
function pkg. or specific filenames.  Hence the "all in one
directory?"  That ADDRESS redirection is an ANSI thing in Regina and
_may_ not be in the native OS/2 classic Rexx.  The other poster used
rxqueue.exe.  BTW "RexxUtil" is also available for Win32 via "REGUTIL"
at
http://www.interlog.com/~ptjm/


Thu, 27 Oct 2005 03:47:50 GMT  
 General Programming Question: Making Backups

Quote:

>  BTW "RexxUtil" is also available for Win32 via "REGUTIL"

Is there a RexxUtil for Linux?

The app for which I'm backing up the settings is a Java app, and I'd
like the script to be useable with minimal modification for at least
Win32, OS/2, and Linux.

Too bad I haven't learned Java yet...

--
Michael DeBusk, Co-Conspirator to Make the World a Better Place
Did he update http://home.earthlink.net/~debu4335/ yet?



Thu, 27 Oct 2005 13:55:28 GMT  
 General Programming Question: Making Backups


Quote:


>>  BTW "RexxUtil" is also available for Win32 via "REGUTIL"

> Is there a RexxUtil for Linux?

Same place.  IIRC it's source code (for NIX) and you'd need to compile
it.  

Quote:

> The app for which I'm backing up the settings is a Java app, and
> I'd like the script to be useable with minimal modification for at
> least Win32, OS/2, and Linux.

Hmm.  Perhaps better to stay away from OS-dependent commands then and
stick with the "RexxUtil" functions...


Thu, 27 Oct 2005 19:45:54 GMT  
 General Programming Question: Making Backups

Quote:

>  Perhaps better to stay away from OS-dependent commands then and
>  stick with the "RexxUtil" functions...

The commands for OS/2 and DOS are the same. I could always set them up
in a variable and let the user choose, or use parse source.

--
Michael DeBusk, Co-Conspirator to Make the World a Better Place
Did he update http://home.earthlink.net/~debu4335/ yet?



Fri, 28 Oct 2005 12:43:52 GMT  
 General Programming Question: Making Backups


may have used oatmeal boxes, old string,
and new, used, and recycled electrons to say (at least in part):

Quote:
>It occurs to me now that I'd like a way of keeping only the three most
>recent backups. I could go in and delete them from a command line, sure,
>but only if I remember to do it.
>This would be easy with RexxUtil but I'd prefer to use plain Rexx. I'll
>appreciate any suggestions. Thanks.

I have a system that does this.  Basically what it does is use 3
directories in a ring, each backup goes into the next (mod 3) directory
after erasing the previous zip file.

--


 In the beautiful Finger Lakes Wine Country of New York State!
 Boardmember of POSSI.org - Phoenix OS/2 Society, Inc
http://www.possi.org
 -- --
 To whom the gods destroy, they first teach Windows...



Sat, 12 Nov 2005 00:34:37 GMT  
 
 [ 18 post ]  Go to page: [1] [2]

 Relevant Pages 

1. questions about a backup program for the MS-DOS environment

2. Making backups

3. CW - general programming question - ideas??

4. programming styles (was: Some general questions about FP)

5. General programming language question

6. General programming question

7. Programming ASP with ActivePython [also a general Web question]

8. Game programming and General Programming News Site

9. NEW Game programming and General Programming News Site

10. Zip App - Free Backup App/Dct Program

11. Auto-Backup of Labview Programs

12. TSR backup program

 

 
Powered by phpBB® Forum Software