Jump to content

NEED HELP FOR A BACKUP SCRIPT


Elkie
 Share

Recommended Posts

Anybody can help me please with my problem

i wanna to build an auto updater script, and the script will be put on the startup folder to auto execute when the user login.

it will check the file on another PC folder(source), if its a different version then the script will automatically replace the similar one with the source files. My problem is can autoIT copy the similar files on the destination dir with the one on the source dir to another folder(backup folder) before the replace process begin?how? :o

Link to comment
Share on other sites

Nah, the problem is DirCopy() copies the entire content of the folder, while i need the command lines to:

I have 2 folders,

srcFold as the source contains b,c files (update of b,c of destFold)

destFold as the destination contains a,b,c,d,e files

i wanna overwrite or add destFold files with those files from srcFold

that means the script is checking the destFold whether it contains similar files with the files in the srcFold and if it exists then those files will copied to another folder named backFold then continue to overwrite contained in the destFold

Link to comment
Share on other sites

the problem is i probably will update different files everyday, so the script have to check is there any simillar files on the dest folder with the one in the source folder and if it's there then the script will automatically backup the files on the destination folder first to the backup folder then continuing with overwriting the similar destination folder files with the source folder files

Link to comment
Share on other sites

Anybody can help me please with my problem

i wanna to build an auto updater script, and the script will be put on the startup folder to auto execute when the user login.

it will check the file on another PC folder(source), if its a different version then the script will automatically replace the similar one with the source files. My problem is can autoIT copy the similar files on the destination dir with the one on the source dir to another folder(backup folder) before the replace process begin?how? :o

There is an excellent freeware backup program that I use and automate with AutoIt that will do what you are looking for called same dir. http://samedir.sbn.bz/

You can set up different scripts and then call them through command line parameters, including making a backup of any files replaced, compression, full directory synch., etc.

Link to comment
Share on other sites

you've asked the same question before

if this problem is so urgent maybe you should at least provide the information given to all the others maybe with a link?

http://www.autoitscript.com/forum/index.ph...topic=21717&hl=

:o

Edited by Nuffilein805
Link to comment
Share on other sites

  • Moderators

you've asked the same question before

if this problem is so urgent maybe you should at least provide the information given to all the others maybe with a link?

http://www.autoitscript.com/forum/index.ph...topic=21717&hl=

:geek:

What's the matter Nuff - not much into tail chasing? :o

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

What's the matter Nuff - not much into tail chasing?

i'm in a bad mood by now, haven't had much sleep, tired, zZz, ZzZ, ...

maybe i should drink some coffee and get me something to eat

anyways here is the working code that does what you want

$desdir = "c:\dest\";destination dir
$srcdir = "c:\test\";source dir
$bakdir = "c:\backup\";backup dir
;lets say you want to copy all files from the source dir to the destination dir
$files = filefindfirstfile($srcdir & "*.*")
while 1
$file = filefindnextfile ($files)
if @error Then exitloop
if $file = "." or $file = ".." Then
Else
    if fileexists ($desdir & $file) then filecopy ($desdir & $file, $bakdir & "*", 8)
EndIf
wend
filecopy ($srcdir & "*", $desdir & "*", 9)

hope that helps you - zZz

just modified my already written code a bit

tried it out about 10 times always changing filenames

Edited by Nuffilein805
Link to comment
Share on other sites

  • Moderators

Removed - Per request... :o

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

oooops used that for some checking and just forgot to remove it

;) btw which line? :sorcerer:

Lmao... it's still in my quote :geek:, I was like what are you talking about :o

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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