Execute Process Task: Batch file don't work through SQL Server Agent job - SQL Server Integration Services
Execute Process Task: Batch file don't work through SQL Server Agent job - SQL Server Integration Services
Hi,
I created a batch file to create copy of SQL database backup file.
@ECHO OFFset year=%date:~10,4%
set month=%date:~4,2%
set day=%date:~7,2%
REM set filename=%year%_%month%_%day%
REM echo %filename%echo F|xcopy /Y "\\Backup\Backup_%year%_%month%_%day%_*.bak" "\\Backup\Backup.bak"
Execute Process Task works fine when I execute it from package. Fails after deploying and running job, do not create copy of the backup file.
Regards
Execute Process Task: Batch file don't work through SQL Server Agent job - SQL Server Integration Services
Does the account running the agent job have access to the destination share?
What error message are you getting?
Execute Process Task: Batch file don't work through SQL Server Agent job - SQL Server Integration Services
I think it is an access issue, source location and targeted database from where I am running job are not different servers.
No error, task executes successfully but can't see copy of file.
Execute Process Task: Batch file don't work through SQL Server Agent job - SQL Server Integration Services
I think it is an access issue, source location and targeted database from where I am running job are not different servers.
No error, task executes successfully but can't see copy of file.
Then don't use a UNC path. Use the local drive letter. And capture stdout and stderr to see if the command works or generates an error.
echo F|xcopy /Y "E:\Whatever\Backup\Backup_%year%_%month%_%day%_*.bak" "E;\Whatever\Backup\Backup.bak" 1> C:\Logs\BackupXcopy.log 2>&1
Execute Process Task: Batch file don't work through SQL Server Agent job - SQL Server Integration Services
Hi A Tanv,
Please check if the user executes the package in sql agent job has enough permission
to access the \\Backup folder.
Best Regards,
Mona