Jump to content

Recommended Posts

Posted

Hello all,

i need help with a small script which will backup a whole drive e.g. D:\ into local disc.

I already wrote some but it dont works as I want. it use DirCopy function with nooverwrite like this:

DirCopy("d:\", "c:\backup\d\" & @UserName, 0)

this work great until I put another CD, then because the directory c:\backup\d\ already exists on the disc, the script will not copy any file

if i use

DirCopy("d:\", "c:\backup\d\" & @UserName, 1)

then it works with new CD but it overwrits files still around (I have a loop in the script) and it take too much CPU even if i put sleep (10000).

Here is whole script:

$i=0

do

$varCD = DriveStatus( "d:\" )

if $varUSB = "READY" then

DirCopy("d:\", "c:\d\" & @UserName, 1)

endif

sleep (10000)

until $i=1

Thank you for help.

Posted

A better way to split up the drive into smaller parts is to do a folder search, nonrecursive. First copy all files in the root directory of the drive to the backup directory. Then do a nonrecursive search for the folders in the root. You can then copy each folder separately to the backup directory. In between each folder copy, you can sleep to lower the cpu usage. If the cpu is still too high, just split up each folder using these steps.

Posted

thanks dantay9, it seem it should works like you say, but i am not so skilled in AutoIt, so can you pls show me some small example?

Thank you

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...