Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

Compress and FTP from HP-UNIX to Windows

Raoof
Regular Advisor

Compress and FTP from HP-UNIX to Windows

Hello Experts,

Need urgent help please.

Environment Details:

HP-Unix 11.31
Windows XP/2003 server

I have the database dump files which will generate on running the cron job with export script at 1 AM and located in /backup directory.

I need the script to compress those dump files i.e. (date.dmp,date.log) immediately after generating it and then transfer to windows drive.

Valuable advices will be highly appreciated.

Thanks & Regards,
Syed



11 REPLIES
Steven Schweda
Honored Contributor

Re: Compress and FTP from HP-UNIX to Windows

> [...] transfer to windows drive.

Why?

Do you plan to _use_ the data on the Windows
system, or only store the data there?

If you need to uncompress (and use) the data
on the Windows system, then it may be helpful
to use Zip to do the compression. If the
Windows system will be used only as back-up
storage, then you could use any convenient
compression program on the HP-UX system.

> [...] FTP [...]

Why FTP? Scripting using FTP usually
involves storing user name and password
information in a (plain-text) file, which is
not very secure. SSH-based methods (scp,
sftp, ...) can be more secure.

> I need the script [...]

Write one? Old Forum threads should supply
any number of examples of scripts which
compress files and/or use FTP (or other
schemes) to send then to another system.
Raoof
Regular Advisor

Re: Compress and FTP from HP-UNIX to Windows

Why?

Do you plan to _use_ the data on the Windows
system, or only store the data there?

>>>
Windows system will be used only as back-up
storage for which i need to compress those dump files and put in this windows drive.


> [...] FTP [...]

Why FTP? Scripting using FTP usually
involves storing user name and password
information in a (plain-text) file, which is
not very secure. SSH-based methods (scp,
sftp, ...) can be more secure.


>>>
I wrote FTP but it doesn't mean that I stick to it? I just want to say that I need to transfer those compressed files either it may be in a gzip or zip format.


> I need the script [...]

>>> For which i need the commands or can say script to make it scheduled to run on specified time.

Hope you got the answers for your questions sir.

Please need valuable advices.

Regards
Steven Schweda
Honored Contributor

Re: Compress and FTP from HP-UNIX to Windows

> [...] make it scheduled to run on specified
> time.

man cron
man crontab


> Write one? Old Forum threads [...]

Still true.
Raoof
Regular Advisor

Re: Compress and FTP from HP-UNIX to Windows

What happen to you steven?? If you cannot give me the proper response then why are you wasting your time by giving replies in a rude way and that too not helpful.

Any other experts please do the needful as i am very new to hpunix.

Hope i get some proper response from other experts.

Regards
Steven Schweda
Honored Contributor

Re: Compress and FTP from HP-UNIX to Windows

> What happen to you steven?? [...]

I'm willing to help you, but I'm not willing
to do your whole job for you (for no money).

> [...] rude [...]

What was rude? Is it rude to expect you to
learn how to do your job by looking at "man"
pages and example scripts in old Forum
postings? If so, then I guess that you're
right, and I was wasting my time.
Raoof
Regular Advisor

Re: Compress and FTP from HP-UNIX to Windows

Any experts please.
Dennis Handly
Acclaimed Contributor

Re: Compress and FTP from HP-UNIX to Windows

You need to break your job down into steps/questions:

1) Do you know how to set up the crontab?

2) What type of logging do you need?

3) What do you do with the files in /backup after you send them to Windows?

4) How to you know you have sent the files and you can remove them? If you can generate them again, you don't have to worry too much when testing your scripting.

5) If the script is going to generate the dump file, gzip them and then ftp/scp them at the same time?

6) Any specific directory structure on the Windows system? Or just the date in the filenames?

7) When do you remove the files (lifetime) on Windows?
raoof_1
Occasional Visitor

Re: Compress and FTP from HP-UNIX to Windows

Dear Dennis,

Thanks for your kind concern. Please find below the answers for your questions.

1) Do you know how to set up the crontab?

A) Yes i know and i already did one to run the script of daily db backup around 1am. After which the dump files are generating in the directory /backup.

2) What type of logging do you need?

A) Sorry i didn't get you on this question.

3) What do you do with the files in /backup after you send them to Windows?

A) Actually I am transferring those dump files from /backup directory from hpunix to the windows in which i have an external disk which is around 10T to be used for backup.

Once it gets transferred to windows drive files should be deleted as it is generating in the server itself.

4) How do you know you have sent the files and you can remove them? If you can generate them again, you don't have to worry too much when testing your scripting.

A) For this i need automated script which will transer and then delete the files from /backup location.


5) If the script is going to generate the dump file, gzip them and then ftp/scp them at the same time?

A) I need to gzip them and then transfer either with ftp or scp or ssh or any other transfer tools as the same time.


6) Any specific directory structure on the Windows system? Or just the date in the filenames?

A)Only the date in the filenames.

7) When do you remove the files (lifetime) on Windows?

A) It depends on the company requirement.


Hope you got to know more about my need with my given answers.

Please do the needful and help me to get rid out from this issue.

Thanks & Best Regards,
Syed
Dennis Handly
Acclaimed Contributor

Re: Compress and FTP from HP-UNIX to Windows

>2A) I didn't get you on this question.

What proof do you need that your program is working and copying files to your Windows box? Do you need to know the filenames and sizes?

>4A) For this I need automated script which will transfer and then delete the files from /backup location.

What type of data integrity checks do you need?
Do you have a way to get the info back and check the contents.

Basically it seems like you want to invent something like Data Protector.
raoof_1
Occasional Visitor

Re: Compress and FTP from HP-UNIX to Windows

Dear Dennis,

I don't know why it is getting more complicated may be i am putting in a wrong way.

I want to let you know what i am doing exactly now.

I am doing these below steps manually on daily basis.

1>

#cd /backup
#tar cf - full.dmp full.log | gzip > /backup/archive_$(date '+%Y%m%d_%H%M%S').tar.gz && rm full.dmp full.log

From the above command it clear shows that the files are getting compressed and deleting after immediatly.

Now once the files get compressed i used to do ftp from windows box to get those files into specified extenal hard drive which is being used for backup.

This is what i am doing manually. For this task only i need to make an automated script which will compress and transer to windows on top of it will delete the original dump files from the /backup directory in hp box.


Hope this will help you to understand what exactly i am doing and what i want to do.

Thanks & Regards,
Raoof
Dennis Handly
Acclaimed Contributor

Re: Compress and FTP from HP-UNIX to Windows

>This is what I am doing manually.

You just need to put it into a script. Something like:
#!/usr/bin/sh

# some comments here ...
cd /backup
archive_file=archive_$(date '+%Y%m%d_%H%M%S').tar.gz
tar cf - full.dmp full.log | gzip > $archive_file && rm full.dmp full.log
ftp -n windows-machine <user:password
bin
cd to-some-windows-path
put $archive_file
ls $archive_file
quit
EOF
# check for bad exit status here

For "to-some-windows-path" you will need to quote each backslash with another.