AIX scripts


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers AIX scripts
# 1  
Old 03-07-2006
AIX scripts

Hi

I need to schedule some tasks on AIX.

At first I must copy files from folder on second AIX server to my primary server. This job schould be done in 1 hour intervals. I want to get only new files.

Second script is needed for old files cleaning. It is necesary to delete files older than 7 days from disk, once a day at night.

I know it is very simple, could you give me some tips?

Regards,
Pit
# 2  
Old 03-08-2006
For the copy you should consider rsync. It's not part of the standard AIX OS, but there are some Power compiled RPM's out there which you could use.

For the deletion a simple find command should do the trik. Something like:

"find /[directory] -atime +7 -exec \rm -f {} \;
# 3  
Old 03-08-2006
Thank You for reply!

I used wget for files download:
wget -a abc.log -r -np -c -nc -nd ftp://userSmilieass@server/path/to/files

In delete script I used:
find . -mtime +7 -exec rm {} \;

Everything works great!

I have one more question. How, on AIX, i can automatically run script on system startup and shutdown?

Pit
# 4  
Old 03-09-2006
Using /etc/inittab. There you can define that something shuld run at each runlevel. The default runlevel for AIX is 2. Therefor you can insert something like this:

ScriptAtBoot:1Smilience:[path to script and parameters]

Define runlevel 1 because to get to runlevel 2 the computer must pass runlevel 1. The keyword once ensures that the script only runs once.

For the system shutdown you would do:

ScriptAtShutdown:0Smilience:[path to script and parameters]

If you would want the script to run also when reboot happens include runlevel 6 in your definition.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find the one file and move destination using scripts in AIX?

I have run the one scripts the scripts is provide the two different format of output.How to getting the output. (2 Replies)
Discussion started by: rajivgandhi
2 Replies

2. Shell Programming and Scripting

How to find the one file and move destination using scripts in AIX?

I have a script which has two output formats in which i'am getting the two different output format in str1 and str2.So i want to get the output if the format is like str1 then i have to copy that into a directory or str2 format means it should be moved.This script i'am executing in shell script... (4 Replies)
Discussion started by: rajivgandhi
4 Replies

3. Shell Programming and Scripting

Execution difference in perl scripts for windows / AIX

Hi, I have perl script abc.pl which runs perfectly fine on windows ( execution from cmd). Now i tried to execute the same perl module on the AIX server after defining the captureoutput.pm and other relevant changes. But its behaving very weirdly as a portion of the URL which is formed by... (3 Replies)
Discussion started by: slayer0611
3 Replies

4. AIX

AIX Boot Scripts

Hi, can someone point me to the bootup file where I can add a samba start up script so I dont have to manually start samba everytime we reboot the server? Thanks. (8 Replies)
Discussion started by: NycUnxer
8 Replies

5. AIX

Startup/shutdown scripts in AIX

hi, If we place Sxx (startup script) and Kxx(shutdown script) in /etc/rc.d/rc2.d,then it would start and stop automatically(assume they are linked to other script that actually starts/stops). is there really a link needed here to /etc/rc.d/init.d? if not,what is the use of this directory..?... (1 Reply)
Discussion started by: to_bsr
1 Replies

6. Shell Programming and Scripting

help with a script that will combine two separate scripts for solaris and aix

Hello experts, I have separate scripts (KSH) each for Solaris and AIX to install core applications (e.g. BigBrother). I also have a script called Installer that gives a menu list to select a particular application to install from a bunch of applications. Now I am trying to combine separate... (7 Replies)
Discussion started by: solaix14
7 Replies

7. AIX

Examples of writing shell scripts for AIX, it's urgent

Please help me 1. Please give me the few examples of shell scripts written for AIX 2.I have scripts written on Unix, does that work for AIX, if not what are the changes to be carried out to run the scripts on AIX.... Please help me (4 Replies)
Discussion started by: me_haroon
4 Replies

8. AIX

How to migrate UP-UX shell scripts to AIX 5.2

Hello, We would to migrate some shell scripts (korn shell) from HP-UX to AIX 5.2 I would know: - If the HP-UX scripts work as well in AIX? - If no, is there a migration tool to detect incompatible lines in scripts? - How do proceed? Our scripts do: - Loads data in Oracle... (1 Reply)
Discussion started by: P026687
1 Replies

9. UNIX for Advanced & Expert Users

Migration UP-UX scripts to AIX.2

Hello, We would to migrate some shell (korn shell) scripts from HP-UX to AIX 5.2 I would know: - If the HP-UX scripts work as well in AIX? - In no, is there a migration tool to detect incompatible lines in scripts? - How do proceed? Our scripts do: - Loads data in Oracle... (1 Reply)
Discussion started by: P026687
1 Replies

10. UNIX for Dummies Questions & Answers

init scripts on AIX

Where are they located? (2 Replies)
Discussion started by: 98_1LE
2 Replies
Login or Register to Ask a Question