Does anyone know if it's possible, (and furthermore advisable) to update all cmdexec strings in jobs on a server?
We'd like to change our logging location, and in principle I'd think this could be done very simply by changing the
/O "\\LOCATION\file.log" strings.
I can see how you'd do that in fact
USE MSDB GO update dbo.sysjobsteps set [command] = replace([command], '\\OLDLOCATION\... ', '\\NEWLOCATION\... ') WHERE...
BUT I've had it drummed into me that you should never update the sys tables manually, so the idea of doing this makes me beyond nervous. For anything else I'd use the dbo.sp_update_job proc (http://msdn.microsoft.com/en-gb/library/ms188745.aspx for those who've strayed here looking for something else job related), but that procedure doesn't seem to be able to handle this.
I have a hunch that this might possibly be an exception to the "Never Update the Sys Tables" rule though? I can't imagine that the cmdexec string is implied in any further relations in the way, for example, enabled/disabled status evidently is. Wishful thinking?
So I don't know for sure, and I can't seem to find out. Anyone know or have any experience with this?