× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



At 10:36 9/25/2003, Buzz Fenner wrote:
I'm needing to write a procedure that can be scheduled to run at night that
copies e-mail backup files from a combo e-mail server/firewall (it has no
command interface) to a folder on the IFS.  A new folder will have to be
created each week for the seven daily backup files.  I have no experience
with FTP and was beginning to take a look at Qshell.  I'm open to
suggestions that will get me pointed in the right direction and I would like
it to be a program/procedure that executes on the AS/400 (v5r2m0).

I have to second James Rich's opinion that it would be easier to do on the unix box. I've got a process that does a backup of my home directories something like that with a bash script:


 cd /home
 tar cp$BACKUPOPT -f - . | (cd $OutputPath/home; tar xf -)

The first tar command copies an entire directory tree from the current working directory, with all its contents, to standard output, which is piped to a sub-shell, which changes to the target directory takes the piped data from standard input and writes it to disk with another instance of tar. It's simple and has been very reliable.

$OutputPath points to a different directory each day. There's one for each day of the week.

BACKUPOPT is either empty, for a full backup, or contains "N `cat /etc/backup.dt`", which evaluates to something like "N 21-Sep", the date of the last full backup, to perform an incremental backup of files changed since then. Each Sunday, BACKUPOPT is left empty and the script updates backup.dt with:

date +"%d-%b" > /etc/backup.dt.

The script runs automatically from cron, the Nix job scheduler, which is pretty easy to set up. Just su (log in as root) and type

crontab -e

That starts a vi session with root's current crontab (schedule). The entry that runs my backup says:

05 00 * * * /usr/sbin/backup

which means, execute /usr/sbin/backup (the script) at 00:05 every day. Be warned though, that vi is a little, uh, cryptic. Press the insert key in order to insert text at the current cursor position, press it again to overwrite text, and press esc to exit to command mode. In commmand mode, type :w to write the changes to disk, and :q to quit (or just :q! to abandon the changes without writing). vi does a lot more, but that's enough to get you going.

To see what's in crontab, type

crontab -l

If you're interested, I can give you the script.


Pete Hall pbhall@xxxxxxxxxxxxx http://www.pbhall.us/


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.