Sign in to follow this  
Followers 0
Elkie

NEED HELP FOR A BACKUP SCRIPT

29 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

DirCopy()? Edited by gamerman2360

Share this post


Link to post
Share on other sites

are you talking about taking like a picture of the entire computer, and if anything is changed it will replace it with what was originaly there? sounds like deepfreeze :o

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Before the file overwrites:

FileCopy($file, $backupDir)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

So you need help seeing if the file is different or has been changed? Search the fourm for getting a file's hash... The problem I have with hashes is there dosn't seem to be a way to do it with out relying on another exe or dll.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

FYI: i used to update files from server to client, so i don't want to use any installed software.

Share this post


Link to post
Share on other sites

FYI: i used to update files from server to client, so i don't want to use any installed software.

Where would you install an AutoIt script then?

You can install samedir on the client and backup files in either direction.

Share this post


Link to post
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=

:geek:

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

[center]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.[/center]

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Removed - Per request... :o

Edited by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

thanks Nuffilein805 and SmOke N i appreciate it and sorry for the new topic cause i'm desperate enough to wait for your response while my topic is getting of the page

Share this post


Link to post
Share on other sites

Nuffilein805! u're a genius and on that kinda condition u still have the brilliant solution for me, take a rest m8, perhaps others still need your help :o, Once again TYVM!

Share this post


Link to post
Share on other sites

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

[center]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.[/center]

Share this post


Link to post
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
Sign in to follow this  
Followers 0