Operating System - HP-UX
1754277 Members
3202 Online
108813 Solutions
New Discussion

Re: Compress and FTP from HP-UNIX to Windows

 
raoof_1
New Member

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.