Script that modifies root level files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script that modifies root level files
# 1  
Old 06-18-2003
Question Script that modifies root level files

I run a decent size Solaris 8 network where we use host files and no DNS servers. I have a master host file to push out to all the machines (also would like to do system and services too) but, the only way I've ever been able to do it is buy telneting into the machine and ftping the file into place as root. I'd like to write a script to do this. Even if I have telnet into the box and su to root and then run. That would be a little better than the way it is now.

Anyone have any ideas on how I would get it to login to the remote machine with ftp? I can request it to ftp to x.x.x.x but then it will need a username and password which the script wont apply properly.

Any thoughts?
# 2  
Old 06-18-2003
You should switch to dns. But if I had to automate this, I would have a dummy user called "hostfile" or something on one system. It would have the official hosts file in it's home directory. Each system would run a root cron job to get this file periodicly.

There are a lot of threads regarding automating ftp jobs. Use our search function to find them.
# 3  
Old 06-18-2003
Thanks for your help. I notice that you are in Rockville MD. Do you happen to work for a company called Globalstar?
# 4  
Old 06-18-2003
You might also want to look at rsync (there are numerous threads on this also) or cfengine. Also, if you have access to the Cluster cd, you can use the pkgadd to load SUNWcluster and use the ccp module to open up to 16 windows at once (to 16 systems) to update, monitor, or control servers.
# 5  
Old 06-18-2003
Yeah, I have rsync and have been using it for a year now. I love it to death but, I can't do root level stuff with it. If I could I wouldn't have even bothered anyone with my questions.

What I'm going to do is run a little script I wrote as root from the target machine. The script will just pipe all the commands I want into ftp and show results verbosely.

I can't go to DNS. It's a long story but, we run a 24X7 operation and if a workstation goes down, we want all the others to be identical in design to be useable as direct swapouts for that failed machine. We also don't use DHCP every machine and LAN/WAN device is static and is listed in my host files. We are also on an isolated WAN that is non-terrestrial so we are nice and safe from outside issues.

So anyhow, it looks like I will get some performance out of this script. Just wish it could do su root too.Smilie
# 6  
Old 06-18-2003
Quote:
Originally posted by turbo90awd
We are also on an isolated WAN that is non-terrestrial so we are nice and safe from outside issues.
Whoa!! Smilie
# 7  
Old 06-18-2003
**cough**satellites**cough**Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to run root level command , if user has "su -" permission in sudoers provided?

I am looking t run root level command on multiple servers, but all servers have only "su - " permission available in sudoers. please help me if any way that I can run command using help of "su -" My script for hosts in `cat hosts.txt`; do echo "###########################Server Name-... (5 Replies)
Discussion started by: yash_message
5 Replies

2. Shell Programming and Scripting

Rsync is not working at root "/" level between two servers

copying daily changes from serverA to serverB using rsync(solaris8, v2.6.2) at root folder level. serverA: cd / rsync -a -vv --delete --checksum --sparse --stats --dry-run --exclude /tmp/ --exclude /proc/ --exclude /devices/ . root@<IP of ServerB>:/ This is generating mainly three debug... (0 Replies)
Discussion started by: kchinnam
0 Replies

3. UNIX for Dummies Questions & Answers

Knowing when a different program modifies a file

so i was testing something on a test box running linux. i manually vi'ed the /var/log/messages file. and i noticed, the file immediately stopped being updated. it wasn't until i restarted the syslog process that events started being recorded in it again. so that tells me, the syslog process... (20 Replies)
Discussion started by: SkySmart
20 Replies

4. Shell Programming and Scripting

Need to run a bash script that logs on as a non-root user and runs script as root

So I have a script that runs as a non-root user, lets say the username is 'xymon' . This script needs to log on to a remote system as a non-root user also and call up a bash script that runs another bash script as root. in short: user xymon on system A needs to run a file as root user and have... (2 Replies)
Discussion started by: damang111
2 Replies

5. Emergency UNIX and Linux Support

Is there any way to set the files modified date and stamp to last modifies time?

Actually i did modification in a file on server by mistake, now its showing current time stamp, is there any way to set the files modified date and stamp to last modifies time. Please advice here.Thanks in advance.:b: (7 Replies)
Discussion started by: saluja.deepak
7 Replies

6. Shell Programming and Scripting

How Can I get terminal no when someone modifies CRONTAB file

Hi All I have a script which drops a mail with the changes done on crontab file for every 1 hour Can anyone pls tell me how can I modify the script so that it should display the terminal from which the crontab file hasbeen modified. Quick responce much appriciated !! Many thanks in... (7 Replies)
Discussion started by: jagadish_gaddam
7 Replies

7. Shell Programming and Scripting

Script for Deleting Core files on root filesystem

ok i am setting up a script to run daily using crontab. This script will search the root filesystem and delete any and all core files. I have set up this script The only problem i get with this script is it searches for directories and attempts to delete them. Since i have probably... (7 Replies)
Discussion started by: rgfirefly24
7 Replies

8. UNIX for Dummies Questions & Answers

Run non-root script as root with non-root environment

All, I want to run a non-root script as the root user with non-root environment variables with crontab. The non-root user would have environment variables for database access such as Oracle or Sybase. The root user does not have the Oracle or Sybase enviroment variables. I thought you could do... (2 Replies)
Discussion started by: bubba112557
2 Replies

9. UNIX for Dummies Questions & Answers

need to get to root level

:confused: In the terminal, it shows i am in the I need to get back into root, HOW DO I DO IT!?!?!?! Anyone who can help please do ASAP thanks Confused mac user trying to learn UNIX jimbo:D (2 Replies)
Discussion started by: jhaven007
2 Replies
Login or Register to Ask a Question