Hello,
I have a sybase installation with SSH access (no root no sudoer).
I wrote a simple bash script for bulk copying out a table into a file.
If I execute the script from the shell, everything works fine. If I put the script in my crontab, the job returns "Server name not found in interface file".
Ok, I thought perhaps it was something like
- the crontab doesnt load an environment variable, so I need to use "absolute" values
- my user's permissions are not enough to load the default interface file
I tried different solutions without hope:
- first of all I assured that my user can reach and read the default interface file (/opt/sybase/interfaces)
- then checked the interfaces content
MYDATA
query tcp ether 127.0.0.1 2000
master tcp ether 127.0.0.1 2000
query tcp ether 210.92.92.1 2000
master tcp ether 210.92.92.1 2000
MYDATA_BACKUP
query tcp ether 127.0.0.1 4000
master tcp ether 127.0.0.1 4000
LOC
query tcp ether 127.0.0.1 2000
master tcp ether 127.0.0.1 2000
STANDBY
query tcp ether 210.92.92.2 2000
master tcp ether 210.92.92.2 2000
- I specified the -S option (tried bcp bla bla -S127.0.0.1 and as well -S210.92.92.1)
- created a new interface file in my home, specifying the server name like
MYDATA
query tcp ether 127.0.0.1 2000
master tcp ether 127.0.0.1 2000
query tcp ether 210.92.92.1 2000
master tcp ether 210.92.92.1 2000
query tcp ether MyServer 2000
master tcp ether MyServer 2000
I still can't realize if the problem resides on bcp, on the crontab, on the user... Thanks for any help.
p.s. if you have another option to dump data in a simple csv format, any solution is welcome.
I have a sybase installation with SSH access (no root no sudoer).
I wrote a simple bash script for bulk copying out a table into a file.
If I execute the script from the shell, everything works fine. If I put the script in my crontab, the job returns "Server name not found in interface file".
Ok, I thought perhaps it was something like
- the crontab doesnt load an environment variable, so I need to use "absolute" values
- my user's permissions are not enough to load the default interface file
I tried different solutions without hope:
- first of all I assured that my user can reach and read the default interface file (/opt/sybase/interfaces)
- then checked the interfaces content
MYDATA
query tcp ether 127.0.0.1 2000
master tcp ether 127.0.0.1 2000
query tcp ether 210.92.92.1 2000
master tcp ether 210.92.92.1 2000
MYDATA_BACKUP
query tcp ether 127.0.0.1 4000
master tcp ether 127.0.0.1 4000
LOC
query tcp ether 127.0.0.1 2000
master tcp ether 127.0.0.1 2000
STANDBY
query tcp ether 210.92.92.2 2000
master tcp ether 210.92.92.2 2000
- I specified the -S option (tried bcp bla bla -S127.0.0.1 and as well -S210.92.92.1)
- created a new interface file in my home, specifying the server name like
MYDATA
query tcp ether 127.0.0.1 2000
master tcp ether 127.0.0.1 2000
query tcp ether 210.92.92.1 2000
master tcp ether 210.92.92.1 2000
query tcp ether MyServer 2000
master tcp ether MyServer 2000
I still can't realize if the problem resides on bcp, on the crontab, on the user... Thanks for any help.
p.s. if you have another option to dump data in a simple csv format, any solution is welcome.