copy files and subfolders

Discuss RoboTask here
Post Reply
bruno.ucc
Posts: 1
Joined: Fri Nov 09, 2012 6:42 pm
Location: Brazil

copy files and subfolders

Post by bruno.ucc »

hi
I'm using robocopy for the first time I would like to help.

I need to copy a folder to folder B. folderA This folder
contains folders that are created every day. need to move
the older directories folders leaving only 6 months ahead.

Thks
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

copy files and subfolders

Post by Oleg »

Algorithm will be similar to this:

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|2099193306
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task664"
Hide=INTEGER|0
ID=INTEGER|1845374931
LogOnAsUser=INTEGER|1
Name=STRING|"Move old folders"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""FOLDERTOMOVE"" with value """""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"FOLDERTOMOVE"

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""DESTFOLDER"" with value """""
Params=FOLDER

[Actions\Action2\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"DESTFOLDER"

[Actions\Action3]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action3\Params]
createmode=STRING|"4"
createormodified=STRING|"1"
date1=STRING|"20121122"
date2=STRING|"20121122"
destvar=STRING|"FOLDERTOMOVE"
DuringDays=STRING|"1"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"C:\incoming\*.*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderHours=STRING|"1"
OlderMinutes=STRING|"1"
OlderMonths=STRING|"6"
savesize=STRING|"0"
searchkind=STRING|"1"
subdirs=STRING|"0"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action4]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""DESTFOLDER"" with value ""c:\dest\{ExtractFileName({FolderToMove})}"""
Params=FOLDER

[Actions\Action4\Params]
expand=STRING|"1"
varname=STRING|"DESTFOLDER"
varvalue=STRING|"c:\dest\{ExtractFileName({FolderToMove})}"

[Actions\Action5]
ActionID=STRING|"A_FOLDER_SYNCHRONIZE"
Enabled=INTEGER|-1
Name=STRING|"Synchronize Folders"
Params=FOLDER

[Actions\Action5\Params]
clearro=STRING|"1"
details=STRING|"0"
exact=STRING|"0"
foder1=STRING|"{FolderToMove}"
foder2=STRING|"{DestFolder}"
hidden=STRING|"1"
howsync=STRING|"1"
includemask=STRING|"*.*"
subdir=STRING|"1"
system=STRING|"1"

[Actions\Action6]
ActionID=STRING|"A_FOLDER_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove Nonempty Folder  ({foldertomove})"
Params=FOLDER

[Actions\Action6\Params]
deletefolder=STRING|"1"
folder=STRING|"{foldertomove}"

[Actions\Action7]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
Post Reply