Job schedules move files

Posted on 2007-10-02
Last Modified: 2010-05-18
I have to schedule the following as jobs

1.backup Db Customer to \\serverA\backups\customercomplete.bak
2.move the file to another server    \\serverA\backups\customercomplete.bak To \\serverb\backups\customercomplete.bak
Step 2
Move  "\\serverA\backups\customercomplete.bak "  "\\serverb\backups\customercomplete.bak"

Job schedule :
Step one is done
I used move to accomplish step 2.  No luck
Question by:ohemaa
    LVL 18

    Expert Comment

    What is the error ?
    Enough permissions for the SQL Server Agent account, as that is the account that performs your jobs for you ?

    Hope this helps ...
    LVL 29

    Expert Comment

    As Yveau says...
    The account that is used to run the Windows Service - Server SQL Server Agent must have write permissions to the backups folder on server B. IF using move then it also needs to have delete (or modify?) permissions on the backup folder on server A.
    LVL 15

    Accepted Solution

    declare @sql varchar(500)
    set @sql = 'move  "\\serverA\backups\customercomplete.bak "  "\\serverb\backups\customercomplete.bak"'
    exec master..xp_cmdshell @sql
    LVL 29

    Expert Comment

    The above would assume that the account running SQL Agent has the necessary permissions to run xp_cmdshell

    Author Comment

    I get the WARNING: The following job steps cannot be reached with the current job step flow logic.
     [2] Move File to ServerB
    Is this the intended behavior?
    LVL 15

    Expert Comment

    NO, is it two separate job steps (backup, then move. If so, you'll need to check your workflow and make sure that after successful completiong of step 1, you execute the next step.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
    Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now