0

I'm trying to create a python script on a linux box that can execute an agent job.

Looking around I found sp_start_job command. But it doesn't seem to exist on python.

Does any one know if it does work on python or any other scripting language executable on linux.

GregL
  • 9,370
  • 2
  • 25
  • 36
maco1717
  • 131
  • 5

1 Answers1

0

It does work.

It would python but in the end decided to do it with bash with FreeTDS like this:

~$TDSVER=8.0 tsql -H serverIPaddress -p portnumber -U domain\\username EOS
>EXEC msdb.dbo.sp_start_job @job_name = 'jobname' ;
>GO
>EOS

it will prompt for password...

this can go in to a script to execute (whenever) probably call it from a python script or just schedule with cron.

maco1717
  • 131
  • 5