This post is more than 5 years old
5 Posts
0
805
April 18th, 2011 11:00
Help with a cron job to export usermapper data
I've got this setup in a shell script, that on it's own works just fine.
#!/bin/bash
/nas/bin/server_usermapper server_2 -Export -user /home/nasadmin/usrmapbackup.passwd
/nas/bin/server_usermapper server_2 -Export -group /home/nasadmin/usrmapbackup.group
I add it to crontab and it generates this error.
NAS_DB environment not defined
What do I need to do to get this working?
No Events found!
dynamox
9 Legend
•
20.4K Posts
0
April 18th, 2011 13:00
Oops..you are running from the script, i thought you were doing directly from crontab. Add these lines
export NAS_DB=/nas
export PATH=$PATH:/nas/bin
dynamox
9 Legend
•
20.4K Posts
0
April 18th, 2011 13:00
NAS_DB=/nas /nas/bin/server_usermapper server_2 -Export -user /home/nasadmin/usrmapbackup.passwd
AaronJAnderson
5 Posts
0
April 18th, 2011 13:00
I added NAS_DB=/nas to the first line and still get the same error when the script runs.
AaronJAnderson
5 Posts
0
April 19th, 2011 04:00
That's the ticket! Thanks for the help.