I have a working script(in perl) that runs fine in /home/me/mydirectory
Now since this should be running continously with no administration,I want this to run automatically if say the computer shuts down and is restarted. So I put in /etc/inittab
myjob:3456:respawn:/home/me/scriptcaller
which says
#!/bin/bash
cd /home/me/mydirectory
su - me -c "perl /home/me/mydirectory/myscript.pl"
The script runs, except that it cannot find data files like
myfile in /home/me/mydirectory/
-by opening and writing to a file, I confirmed that it only looks in /home/me
I thought I hqad taken care of this by putting
/home/me/mydirectory in $PATH, both in /etc/profile and
in .bashrc
What am I missing here?
Now since this should be running continously with no administration,I want this to run automatically if say the computer shuts down and is restarted. So I put in /etc/inittab
myjob:3456:respawn:/home/me/scriptcaller
which says
#!/bin/bash
cd /home/me/mydirectory
su - me -c "perl /home/me/mydirectory/myscript.pl"
The script runs, except that it cannot find data files like
myfile in /home/me/mydirectory/
-by opening and writing to a file, I confirmed that it only looks in /home/me
I thought I hqad taken care of this by putting
/home/me/mydirectory in $PATH, both in /etc/profile and
in .bashrc
What am I missing here?