July 9, 2015 at 5:39 am
I will try again and report back.
July 9, 2015 at 5:57 am
This is the error I am receiving:
A job step received an error at line 17 in a PowerShell script.
The corresponding line is 'throw("Failure in copying $SourceLocation files to $DestinationLocation. Details: $CaptureOutput");'.
Correct the script and reschedule the job. The error information returned by PowerShell is:
'Failure in copying E:\xxxxxxx.xxxxxxx\xxxxx\Backup\sssssss\master\FULL\ files to
\\yyyyyy\Backups\sssssss\master\FULL. Details: 2015/07/09 06:44:56 ERROR 3 (0x00000003)
Accessing Source Directory E:\xxxxxxx.xxxxxxx\xxxxx\Backup\sssssss\master\FULL\
The system cannot find the path specified. '. Process Exit Code -1. The step failed.
----
The file on the E drive is written within this code as E:\xxxxxxx.xxxxxxx\xxxxx\Backup\sssssss$bbbbbbb\master\FULLso it looks like the $bbbbbbb is being ignored. It may be a problem with PowerShell?
Thanks
Kathy
July 9, 2015 at 6:36 am
kathy.plamann (7/9/2015)
This is the error I am receiving:A job step received an error at line 17 in a PowerShell script.
The corresponding line is 'throw("Failure in copying $SourceLocation files to $DestinationLocation. Details: $CaptureOutput");'.
Correct the script and reschedule the job. The error information returned by PowerShell is:
'Failure in copying E:\xxxxxxx.xxxxxxx\xxxxx\Backup\sssssss\master\FULL\ files to
\\yyyyyy\Backups\sssssss\master\FULL. Details: 2015/07/09 06:44:56 ERROR 3 (0x00000003)
Accessing Source Directory E:\xxxxxxx.xxxxxxx\xxxxx\Backup\sssssss\master\FULL\
The system cannot find the path specified. '. Process Exit Code -1. The step failed.
----
The file on the E drive is written within this code as E:\xxxxxxx.xxxxxxx\xxxxx\Backup\sssssss$bbbbbbb\master\FULLso it looks like the $bbbbbbb is being ignored. It may be a problem with PowerShell?
Thanks
Kathy
In Powershell a $ is used to denote a variable, if you need to include a $ you'll need to enclose the string in a couple of ways.
As a literal like so
'$'
As an expanding string (where variables will be filled with the values assigned) like so
"`$"
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
July 9, 2015 at 8:15 am
kathy.plamann (7/8/2015)
...I use Ola Hallegren's backups which create a folder called xxxx$xxxx. Robocopy can't seem to handle the $.
...
Have you considered modifying the T-SQL scripts, or perhaps there is a configuration setting table, so that they backup to a folder without '$' in the path name?
Meanwhile, the folder you have at the moment can be renamed.
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
July 9, 2015 at 8:33 am
Perry Whittle (7/9/2015)
patrickmcginnis59 10839 (7/9/2015)
That's true, I don't have to have that functionality in a copy operation, as long as there was some other way to manage the bandwidth that the copy operation consumes. But having that functionality in robocopy sure is handy!Begs the question, what on earth are you doing that makes that much of an impact to require packet control?
Its just our site to site link. It does business pretty much 24x7, and I want a file copy to happen at the same time, the copy doesn't have to be fast, but it helps that pacing or managing the bandwidth allows our other processes to run normally. Robocopy is perfect, because the interpacket gap allows the other business to run with as little impact as we need and still get our rather largish files copied.
Its essentially a very easy way to do network traffic control at least as far as the copy operation goes.
July 9, 2015 at 10:45 am
robocopy e:\backup|xxx'$'xxx\master\Full "*.bak" \\sharebackup\xxx'$'xxx\master\Full worked!!
I couldn't assign variables to represent the $SourceLocation = e:\backup|xxx'$'xxx\master\Full or $DestinationLocation = \\sharebackup\xxx'$'xxx\master\Full that I use to do error checking. So if you know how to do that let me know.
At least I can get them copied to the fileshare. To be complete I would like to include the error checking.
By the way the script I am using is from another SQLServerCentral member (so thank you)
Thanks for all the input. I have learned a great deal.
Kathy
July 9, 2015 at 10:48 am
I did consider changing the Ola's script but I would have had to learn how to deal with tokens, which I will learn eventually. So I made the decision to continue with the powershell and robocopy.
I have much to learn.
Thanks
Kathy
July 9, 2015 at 11:29 am
try quotes?
$SourceLocation = "e:\backup|xxx'$'xxx\master\Full"
$DestinationLocation = "\\sharebackup\xxx'$'xxx\master\Full"
Not sure if the single quotes inside the double quotes will still escape your $ for you, but you could try with first and then without. Wild guess tho, so make sure you test!
Also
http://ss64.com/ps/syntax-esc.html
has some info on escape characters, to prevent or facilitate different interpretations of characters in your powershell scripts.
July 9, 2015 at 11:43 am
patrickmcginnis59 10839 (7/9/2015)
try quotes?
$SourceLocation = "e:\backup|xxx'$'xxx\master\Full"
$DestinationLocation = "\\sharebackup\xxx'$'xxx\master\Full"
Not sure if the single quotes inside the double quotes will still escape your $ for you, but you could try with first and then without. Wild guess tho, so make sure you test!
Also
http://ss64.com/ps/syntax-esc.html
has some info on escape characters, to prevent or facilitate different interpretations of characters in your powershell scripts.
Ok my prior guess was wrong! neither quotes or no quotes would work, but the backtick works for me using just a simple assignment, this is the unshifted tilde key. So maybe try that?
$SourceLocation = "e:\backup\xxx`$xxx\master\Full"
$DestinationLocation = "\\sharebackup\xxx`$xxx\master\Full"
July 9, 2015 at 12:41 pm
If you don't have time for puzzle solving and just need it to work, then consider mapping the folder under another share name that doesn't contain the '\xxxx$xxxx\' portion.
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
July 9, 2015 at 2:02 pm
$SourceLocation = "e:\backup\xxx`$xxx\master\Full"
$DestinationLocation = "\\sharebackup\xxx`$xxx\master\Full"
Thanks 500!!
This worked. This problem now solved.
Thanks everyone
July 9, 2015 at 2:27 pm
plamannkathy (7/9/2015)
$SourceLocation = "e:\backup\xxx`$xxx\master\Full"$DestinationLocation = "\\sharebackup\xxx`$xxx\master\Full"
Thanks 500!!
This worked. This problem now solved.
Thanks everyone
did you even bother to read my last post
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
July 9, 2015 at 2:28 pm
Perry Whittle (7/9/2015)
kathy.plamann (7/9/2015)
This is the error I am receiving:A job step received an error at line 17 in a PowerShell script.
The corresponding line is 'throw("Failure in copying $SourceLocation files to $DestinationLocation. Details: $CaptureOutput");'.
Correct the script and reschedule the job. The error information returned by PowerShell is:
'Failure in copying E:\xxxxxxx.xxxxxxx\xxxxx\Backup\sssssss\master\FULL\ files to
\\yyyyyy\Backups\sssssss\master\FULL. Details: 2015/07/09 06:44:56 ERROR 3 (0x00000003)
Accessing Source Directory E:\xxxxxxx.xxxxxxx\xxxxx\Backup\sssssss\master\FULL\
The system cannot find the path specified. '. Process Exit Code -1. The step failed.
----
The file on the E drive is written within this code as E:\xxxxxxx.xxxxxxx\xxxxx\Backup\sssssss$bbbbbbb\master\FULLso it looks like the $bbbbbbb is being ignored. It may be a problem with PowerShell?
Thanks
Kathy
In Powershell a $ is used to denote a variable, if you need to include a $ you'll need to enclose the string in a couple of ways.
As a literal like so
'$'
As an expanding string (where variables will be filled with the values assigned) like so
"`$"
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
July 9, 2015 at 2:55 pm
Perry Whittle (7/9/2015)
plamannkathy (7/9/2015)
$SourceLocation = "e:\backup\xxx`$xxx\master\Full"$DestinationLocation = "\\sharebackup\xxx`$xxx\master\Full"
Thanks 500!!
This worked. This problem now solved.
Thanks everyone
did you even bother to read my last post
I think you had the right solution, if that helps any. I know I was wrong with my first guess.
At the same time, your explanation and exposition caused me to discard your solution despite you actually posting the right thing, and I'm happy to take the blame for misinterpreting and subsequently disregarding your post, but disregard it I did!
July 10, 2015 at 2:38 am
patrickmcginnis59 10839 (7/9/2015)
Perry Whittle (7/9/2015)
plamannkathy (7/9/2015)
$SourceLocation = "e:\backup\xxx`$xxx\master\Full"$DestinationLocation = "\\sharebackup\xxx`$xxx\master\Full"
Thanks 500!!
This worked. This problem now solved.
Thanks everyone
did you even bother to read my last post
I think you had the right solution, if that helps any. I know I was wrong with my first guess.
At the same time, your explanation and exposition caused me to discard your solution despite you actually posting the right thing, and I'm happy to take the blame for misinterpreting and subsequently disregarding your post, but disregard it I did!
Mate are you for real, try reading the etiquette yourself.
Your response of "try quotes" when you don't actually know the difference between single and double quotes in PoSh is quite frankly ridiculous.
My post was clear and concise and gave an explanation of the difference backed by examples and it was directed for the benefit of the OP.
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
Viewing 15 posts - 16 through 30 (of 33 total)
You must be logged in to reply to this topic. Login to reply