T37 - Synchronize folders |
Task Description |
Synchronize two folders
T37.atmn
Note: Save the .atmn file in My Documents -> Automation Anywhere -> Automation Anywhere -> My Tasks.
|
| Solutions |
 |
Create New Task
Click on New -> Task Editor. |
Screenshot 1
Screenshot 2
Screenshot 3
Screenshot 4
|
 |
Loop through each file in a folder
Using the Loop command from the Conditions / Loops category, select "Each file in a folder" option. Select a source folder by clicking on the "Browse..." button.
Start Loop " Each File in F:\SourceFolder"
End Loop |
 |
Check for the existence of the file in the destination folder
Using the IF command from the Conditions/Loops category, select "File does not exist" option from the IF interface. In the "Select File" textbox specify "F:\DestinationFolder\$FileName$.$Extension$".
Note: "F:\DestinationFolder\": It is destination folder in which the current file is to be searched.
"$FileName$.$Extension$": $FileName$ and $Extension$ are system variables.
$FileName$ : Contain the name of the file currently referred in the loop without the extension.
$Extension$: Contain the extension of the file currently referred in the loop. |
 |
Copy the file from the source folder, if the file does not exist in the destination folder
Using the Files/Folders command from the Programs/Files/Windows category, select "Copy File(s)" option from the Files /Folders interface. In the "Source File(s) with Path" textbox specify, "F:\SourceFolder\$FileName$.$Extension$". and in the "Destination Folder with path specify "F:\DestinationFolder\$FileName$.$Extension$"
Note: "F:\SourceFolder\": It is the source folder referred in the loop, from which the file has to be deleted.
"F:\DestinationFolder\": It is the destination folder, whose files are compared with the source folder. |
 |
Synchronize destination folder
Repeat steps 2,3 and 4, for coping files from destination folder that are not existing in source folder. |
|
| When you run this task, it will create new folders in your given drive and backup data from your local folders to these newly created folders. |
|
 |
| We started using this product to copy data from legacy system to new system. Now we use it just to do about anything automated. Countless hours saved. Thank you guys. |
- Jack Greenberg
|
| Read Customer Testimonies >> |
|