Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

batch files

Thread Tools
 
Search this Thread
 
Old 29 October 2008, 05:04 PM
  #1  
Stefanie
Guest
Thread Starter
 
Stefanie's Avatar
 
Join Date: Apr 2002
Posts: 173
Likes: 0
Received 0 Likes on 0 Posts
Default batch files

Anyone good at batch files, its sequences and why the latter parts don't run..

i've got a batch file which runs some ntbackup jobs in sequence then copies them to another server.

The xcopy's don't run, any reasons why, I thought when one line is done it goes on to the next till the end?
Old 29 October 2008, 07:36 PM
  #2  
warrenm2
Scooby Regular
 
warrenm2's Avatar
 
Join Date: Aug 2003
Location: Epsom
Posts: 5,832
Likes: 0
Received 0 Likes on 0 Posts
Default

try robocopy for a start - and maybe posting a link to the code?
Old 29 October 2008, 07:50 PM
  #3  
HankScorpio
Scooby Regular
 
HankScorpio's Avatar
 
Join Date: Feb 2004
Posts: 5,848
Likes: 0
Received 0 Likes on 0 Posts
Default

pm me what you got, I got stuck in the dark ages with batches and never made it past them but got quite proficient.
Old 30 October 2008, 10:12 AM
  #4  
Stefanie
Guest
Thread Starter
 
Stefanie's Avatar
 
Join Date: Apr 2002
Posts: 173
Likes: 0
Received 0 Likes on 0 Posts
Default

ok i tried robocopy, much better. Is it supposed to copy all the permissions down the folder file tree, because it didnt seem to. Just use /COPYALL /E ?

Also how do you deal with folders with spaces in the names?

What is the quickest easiest way of copying all folders all files and importantly ALL permissions from one server to another?

robocopy "\\server1\Dept\IT\Private\blah blah folder" "\\server2\Dept\IT\Private\blah blah folder" /copyall /e

Is this correct for folders and permissions to be copied correctly down the tree?

Last edited by Stefanie; 30 October 2008 at 10:52 AM.
Old 30 October 2008, 06:48 PM
  #5  
David_Wallis
Scooby Regular
 
David_Wallis's Avatar
 
Join Date: Nov 2001
Location: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Posts: 15,239
Likes: 0
Received 1 Like on 1 Post
Default

/sec for permissions also add /r:1 /w:1 otherwise it can take a while if it hits an error.

For folders with spaces add quotes.

if your backing up /xo only copies files that have changed.
Old 30 October 2008, 09:33 PM
  #6  
Removed.
Scooby Regular
 
Removed.'s Avatar
 
Join Date: Mar 2006
Location: Guernsey
Posts: 1,441
Likes: 0
Received 0 Likes on 0 Posts
Default

Later versions of robocopy dropped the /sec, use /copyall as you suggested.
Old 31 October 2008, 02:46 PM
  #7  
Stefanie
Guest
Thread Starter
 
Stefanie's Avatar
 
Join Date: Apr 2002
Posts: 173
Likes: 0
Received 0 Likes on 0 Posts
Default

why the hell doesn't it preserve permissions, i've still got to go back into all the files to add/remove them...
Old 31 October 2008, 02:51 PM
  #8  
HankScorpio
Scooby Regular
 
HankScorpio's Avatar
 
Join Date: Feb 2004
Posts: 5,848
Likes: 0
Received 0 Likes on 0 Posts
Default

Later version have sec as well as copyall

Code:
/SEC :: copy files with SECurity (equivalent to /COPY:DATS).
/COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU).

Put in:
/tee /log:%temp%\robolog.txt

and post up the header and summary from the log.
Old 31 October 2008, 11:44 PM
  #9  
Removed.
Scooby Regular
 
Removed.'s Avatar
 
Join Date: Mar 2006
Location: Guernsey
Posts: 1,441
Likes: 0
Received 0 Likes on 0 Posts
Default

Originally Posted by ChunkyDunky
Later versions of robocopy dropped the /sec, use /copyall as you suggested.
Whoops, my mistake
Old 01 November 2008, 02:18 PM
  #10  
Removed.
Scooby Regular
 
Removed.'s Avatar
 
Join Date: Mar 2006
Location: Guernsey
Posts: 1,441
Likes: 0
Received 0 Likes on 0 Posts
Default

I know, it's sad, but I looked at the manual for Robocopy XP010 and in it, it says
"Note
The /TIMFIX or /SECFIX switches are no longer supported. If you have scripts that use these switches you must edit them to use /COPY: instead. /COPY:T replaces the old /TIMFIX, and /COPY:S replaces the old /SECFIX."


I was sure I'd had to redo a load of scripts when we moved to that version, as the older version didn't support really long paths. Not the sitch I remembered, but I'm glad I'm not completely gaga.

However I see that those switches are back in the Vista version.

Back to the OP's problem, ensure that the account you are using has adequate rights on the target server. If the target folder is a share, the share permissions must be full control, as well as the folders security, or you can't set ntfs permissions.

Last edited by Removed.; 01 November 2008 at 02:21 PM. Reason: Changed quote to italics
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
yabbadoo4
ScoobyNet General
11
30 September 2015 10:33 PM
Nick_Cat
Computer & Technology Related
2
26 September 2015 08:00 AM
Littleted
Computer & Technology Related
0
25 September 2015 08:44 AM
ALi-B
Computer & Technology Related
0
14 September 2015 07:49 AM
riiidaa
ScoobyNet General
1
12 September 2015 11:52 AM



Quick Reply: batch files



All times are GMT +1. The time now is 05:39 PM.