-
problem with a bash script in a job
My job consist in the execution of a DTS. During it, I execute this bash script :
Code:
echo pays,log,web>"C:\Documents and Settings\pivotaltest\My Documents\webqueue_fr.txt"
::parcours du répertoire h:, pour chaque repertoire inscription du nombre de fichier de ce dernier + nom repertoire dans le fichier webqueue_fr.txt
for /F "usebackq delims=" %%v in (`dir g: /a:d /b`) do (
dir "g:/%%v" | find ".hsy" /c /i>tmp_fr.txt
::/p attend une réponse de l'utilisateur(le fichier texte pour nous)
set /p tmp=<tmp_fr.txt
echo fr,%%v,!tmp!>>"C:\Documents and Settings\pivotaltest\My Documents\webqueue_fr.txt"
::/a attend une expression numérique
set /a tmp=0
)
::del /s tmp_fr.txt
It runs well on the dts, but when i do a job, i have the following errors :
Code:
The system cannot find the path specified.Could Not Find C:\WINNT\system32\tmp_fr.txt
I have the feeling, that the txt files are not created, but I don't know why...
anyone have ideas on this issue ?
-
replace this statement
>tmp_fr.txt
with
>c:\tmp_fr.txt
and
replace this statement
del /s tmp_fr.txt
with
del /s c:\tmp_fr.txt
replace this statement
<tmp_fr.txt
with
<c:\tmp_fr.txt
-
I have ever try this trick, but this doesn't resolve my issue. In fact, the files are saved in "system32", but i don't know why ?
Last edited by gatsu; 07-03-2006 at 10:14 AM.
-
by default command prompt uses c:\windows\system32 as the current
folder.
-
it's strange, now my files are created on "C:\Program Files\Microsoft SQL Server\80\Tools\Binn" even i specify the path
-
You may need add 'cd c:\dir_name' in your script before saving file.
-
finally, i have notice where is the problem :
[CODE]cd E:\Analyse_synchro_pivotal
dir "f:/%%v" | find ".hsy" /c /i>"tmpuk.txt"[/CODEE]
the redirection isn't made.
-
hi,
After many an many attempts, i have always my problem (the tmpuk.txt file is not created at the command dir)
i have try to use rigid path, and this is the same thing.
Anyone can help me please ?
this is my last version of my bash script :
Code:
e:
cd "Analyse_synchro_pivotal"
echo pays,log,web>"E:\Analyse_synchro_pivotal\webqueue_uk.txt"
::parcours du répertoire h:, pour chaque repertoire inscription du nombre de ::fichier de ce dernier + nom repertoire dans le fichier webqueue_uk.txt
for /F "usebackq delims=" %%v in (`dir J: /a:d /b`) do (
e:
cd Analyse_synchro_pivotal
dir "J:/%%v" | find ".hsy" /c /i>tmpuk.txt
::/p attend une réponse de l'utilisateur(le fichier texte dans notre cas)
set /p tmp=<"E:\Analyse_synchro_pivotal\tmpuk.txt"
echo uk,%%v,!tmp!>>"E:\Analyse_synchro_pivotal\webqueue_uk.txt"
::/a attend une expression numérique
set /a tmp=0
)
Last edited by gatsu; 07-20-2006 at 09:36 AM.
-
I see on Google groups that a job is executed by a specific user, anyone can explains me more on this point ?
thanks
-
Who is job owner? If owner is member of sysadmin, the job is run under sql agent service account.
-
the job owner is a member of sysadmin, and it's an windows user with authentification windows. So, what are the permissions of this jobs : those of my job owner, or those of the agent service (how can i see the permissions of it on the different folders ?)
-
Then you should check permission of sql agent service account? Start sql agent with domain account if you need access remote files in the job.
-
So the sql agent takes the permissions of the user wich is authentified on the windows session ? but when my job will execute, it will takes the permissions of its owner ?
-
Any job owned by member of sysadmin runs under sql agent service account's credential.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|