[wplug] script help

Russ Schneider russ at sugapablo.com
Fri Oct 31 08:51:38 EST 2003


I have 2 hard drives on my machine.  One for linux, the other for windows.

Usually all I use the windows drive for is to back up files from my 
linux drive.

I'd like to write a script and cron it so that it would run these 
commands for copying the files every week or so in the middle of the 
night, but some of the commands need to be run under different users. 
Such as:

cp -Ruf /home /mnt/windows/backup/ (needs to be run as root)
pg_dumpall > /mnt/windows/backup/file.sql (needs to be run as postgres)

et cetera....

If I were to write a simple BASH script to run these commands, how could 
I get the commands to run as particular users?


(Note: I don't know if there's a password for user postgres, I just su 
postgres from root.)


-- 
[ Russ Schneider (a.k.a. Sugapablo)     ]
[ http://www.sugapablo.com <--music     ]
[ http://www.sugapablo.net <--personal  ]
[ sugapablo at 12jabber.com   <--jabber IM ]




More information about the wplug mailing list