LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices


Reply
  Search this Thread
Old 01-17-2007, 10:53 PM   #1
mani_um
LQ Newbie
 
Registered: Sep 2006
Posts: 6

Rep: Reputation: 0
AIX script


Hi Sir,
I need your help plz,
i am using unix AIX version 5.3
i want script to zip all the files in folder source as path below
/home/subramani/source

after zip i want to backup to my pc using ftp,this need to be done everyday 12 mightnight... the backup of old file has to be overrite if can
so can u help me out with this script
thanks in advance
 
Old 01-18-2007, 08:04 PM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 30
The best way to start is to write a script that is as close to working as you can, and then come back to us with questions about why specific lines in the script don't work.

There are several pieces to this project. If you have individual questions about individual pieces, you may wish to ask them individually.
 
Old 01-19-2007, 12:13 AM   #3
mani_um
LQ Newbie
 
Registered: Sep 2006
Posts: 6

Original Poster
Rep: Reputation: 0
thanks for ur reply..
 
Old 01-21-2007, 10:31 PM   #4
mani_um
LQ Newbie
 
Registered: Sep 2006
Posts: 6

Original Poster
Rep: Reputation: 0
hi sir thanks for ur help..i hav alter like this
Code:
HOST='200.1.3.116'
USER='mani'
PASSWD='mani123'

cd /home/subramani/source/
gzip *
ftp -n  $HOST <<!EOF
quote USER $USER
quote PASS $PASSWD
prompt
cd /home/mani/backup_folder
mput *.gz
bye
!EOF
i plan to overwrite only files has been changed to the backup_folder

if can i need something like source.zip or source.gz but in my UNIX AIX system i cant use zip command but there is only unzip command
above code work but it igonre folders in source
Just for ur info i dunt hav root passwrd i only normal user...
so i dunno how to use crontab tht u said...how to set system time to back up
thanks again sir...
hope to hear reply for u again
 
Old 01-22-2007, 05:11 AM   #5
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 30
Several points.

First, I don't understand exactly why you want to use zip. But if you do, and zip is not available, see whether gzip and gunzip are available.

Second, the only way I know of that you can get to subdirectories is if you use a shell account on the target machine (200.1.3.116). Write a shell script on that machine which uses the "find" command to find all files which have been modified since a certain time. The find command will go to subdirectories as needed. In that script, use tar to combine all those files into a tarball. Each time you run this script, that tarball should overwrite any you've run on previous days.

Then use crontab to set this to run every morning at, say, 1:00 a.m.

Then, on your own machine, use cron to do the ftp you've already illustrated. Set it to run every morning at, say, 2:00 a.m., just to be safe.

You normally don't need to be root to run crontab.

Try these commands:

man find
man tar
man crontab

You might have more questions as you do this, but this should get you started.

Hope this helps.
 
Old 04-03-2007, 01:31 PM   #6
mudman69
Member
 
Registered: Mar 2007
Distribution: Whatever Works
Posts: 44

Rep: Reputation: 16
I would suggest to not put your FTP user name and password in a script. In AIX when you FTP it will check your $HOME directory for a file named ".netrc". This file contains autologin info for the FTP client. In your case the contents of the file would look like this "machine 200.1.3.116 login mani password mani123". Also you will have to change the permissions on the file to 600.
 
Old 04-03-2007, 11:35 PM   #7
mani_um
LQ Newbie
 
Registered: Sep 2006
Posts: 6

Original Poster
Rep: Reputation: 0
there is no file with that name in my home directory,
i have created one file as u said and how to use it
if i type ftp its not autologin
are sure if will work?
 
Old 04-04-2007, 06:21 AM   #8
mudman69
Member
 
Registered: Mar 2007
Distribution: Whatever Works
Posts: 44

Rep: Reputation: 16
When you created the file did you set the permissions? "chmod 600 .netrc"?

This link will help you with the file format as well. http://linux.about.com/library/cmd/blcmdl5_netrc.htm
 
Old 04-05-2007, 05:47 PM   #9
Yordan
Member
 
Registered: Nov 2004
Posts: 57

Rep: Reputation: 15
First I would suggest to perform
tar cvf /home/sourcebackup.tar /home/subramani/source
followed by
gzip /home/sourcebackup.tar

If you want to ftp /home/sourcebackup.gz to your pc, you must first have a ftp server installed on your pc.
I would suggest something different.
First of all, create a shared disk resource, for instance share your d:\backups as "backup".
Then, install cifs on your AIX machine, and then mount \\yourpc\backup on /remotebackup
then, simply, when you want (for instance every midnight if you find it suitable) from the AIX machine, by hand or by script or by cron, simply do
cp /home/sourcebackup.gz /remotebackup

HTH
Yordan
 
Old 04-13-2007, 09:45 AM   #10
acascianelli
Member
 
Registered: Oct 2002
Location: Michigan
Posts: 71

Rep: Reputation: 15
What about using bzip2 compression instead of gzip. Bzip2 should will compress a little.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
System hangs in update of AIX from 4.3.3 to AIX 5.2 jmurray67 AIX 2 07-25-2004 08:25 PM
Remote Win Bat File execute Shell Script on AIX Server DriveMeCrazy AIX 5 05-26-2004 06:24 PM

LinuxQuestions.org > Forums > Other *NIX Forums > AIX

All times are GMT -5. The time now is 02:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration