Copy from multiple folders into a single FTP folder
11 posts
• Page 1 of 1
Copy from multiple folders into a single FTP folder
Couldn't find an answer to the following question:
Got to copy - or better "consolidate" - source files from multiple directories:
C:\Users\Public\Product Images\437x656
C:\Users\Public\Product Images\344x516
into a single FTP directory \pictures-ftp. All files located in the source directories should be copied to this single directory and we shall NOT copy/maintain the same subfolder structure...
Who can help to set up the profile properly?
Thanks!
Got to copy - or better "consolidate" - source files from multiple directories:
C:\Users\Public\Product Images\437x656
C:\Users\Public\Product Images\344x516
into a single FTP directory \pictures-ftp. All files located in the source directories should be copied to this single directory and we shall NOT copy/maintain the same subfolder structure...
Who can help to set up the profile properly?
Thanks!
- janmarks
- Newbie

- Posts: 1
- Joined: Wed Apr 25, 2007 4:47 pm
mickyj wrote:Hi, you'll need two profiles (one for each source). Put them into a group and run/schedule the group.
But how would one do this for say about 360 folders.....
I need to consolidate files found in dated folders for a whole year. The folders are dated 01-12 for the months with each month folder having say 01-31 for subfolders. Devices call into this system and drop a specific file in the right folder depending on what date the data is for.
I'm using SyncBackSE to transverse the folders to aggregate the files and want to put them on an FTP server in one singular destination point without any subfolders. What I'm getting are all the subfolders for the files. I do not wish to have any folder structure - just the files found.
Any other suggestions on how I can do this?
The file filter is like *.MMS.XML and each are uniquely serialized.
Thank you for your help!
Merc.
- m3rc4ry
- Newbie

- Posts: 5
- Joined: Fri Jan 04, 2008 3:43 pm
It's called folder-flattening, and you can't do it in SB freeware (or SBSE). This is a policy decision by 2BS due to the risk of file overwrites (ie, for files of the same name in different folders, last copy wins. Imagine the screams of innocent new users...)
You can mock it up as mickyj described with multiple profiles, but as you say that's not realistic for hundreds of folders.
Assuming all the folders are in one tree, and you have space to temporarily copy them to a holding area, you can work around it using a VB script to flatten the files into the holding area, then use SBSE to transfer them to FTP. The following script will do it
If there's anything about the filenames you haven't told me, feel free to amend the comparison function accordingly! Hope this is of some use
Rgds
DW
You can mock it up as mickyj described with multiple profiles, but as you say that's not realistic for hundreds of folders.
Assuming all the folders are in one tree, and you have space to temporarily copy them to a holding area, you can work around it using a VB script to flatten the files into the holding area, then use SBSE to transfer them to FTP. The following script will do it
- Code: Select all
' Script designed to scan a tree of folders searching for files as defined by ExprComp function
' and to "pour" the matching candidates into a 'flat' destination (no tree created)
' will overwrite files without warning, including those of same name in diff folders of Source
' last file copied wins!
' written/adapted by Dave Wilkins Jan 2008
SourcePath = "D:\Source Files" ' DO NOT INCLUDE TRAILING BACKSLASH
DestPath = "D:\Flattened Files\" ' *DO* INCLUDE TRAILING BACKSLASH
Set fso = CreateObject("scripting.filesystemobject")
Set folders = fso.GetFolder(SourcePath)
Recurse folders
'= = = = = = = = = START OF SUBS & FUNCTIONS = = = = = = = = = =
Sub Recurse(ByRef folders)
Set subfolders = folders.Subfolders
Set sourcefiles = folders.Files
For Each file In sourcefiles ' traverse each (sub)folder
If ExprComp(file.Name) Then
On Error Resume Next
file.Copy DestPath
End If
Next
For Each folder In subfolders
recurse folder
Next
Set subfolders = Nothing
Set sourcefiles = Nothing
End Sub
Function ExprComp (CompStr)
' designed to check for filename Like *.MMS.XML
CompStr = UCase(CompStr) ' trap lower-case instances
If Right(CompStr, 8) = ".MMS.XML" Then
ExprComp = True
Else
ExprComp = False
End If
End Function
If there's anything about the filenames you haven't told me, feel free to amend the comparison function accordingly! Hope this is of some use
Rgds
DW
- Dave Wilkins
- 2BrightSparks Staff

- Posts: 6982
- Joined: Thu Jan 04, 2007 10:02 am
dwilkins11c wrote:It's called folder-flattening, and you can't do it in SB freeware (or SBSE). This is a policy decision by 2BS due to the risk of file overwrites (ie, for files of the same name in different folders, last copy wins. Imagine the screams of innocent new users...)
You can mock it up as mickyj described with multiple profiles, but as you say that's not realistic for hundreds of folders.
Assuming all the folders are in one tree, and you have space to temporarily copy them to a holding area, you can work around it using a VB script to flatten the files into the holding area, then use SBSE to transfer them to FTP. The following script will do it
Thanks and understand the reasoning completely....
As you've proposed, writing a VB script was also my thoughts.....
It would be nice however if there was a "folder flattening" option though in the software and that you can choose to overwrite a duplicate or append say a number to a file if a duplicate is encountered.
However even without this option this application is awesome!
- m3rc4ry
- Newbie

- Posts: 5
- Joined: Fri Jan 04, 2008 3:43 pm
Hi - I'm back.....
I've been running SBSE with much success but still wish to reiterate that there needs to be an option to allow folder flattening on the destination. We've found it too cumbersome to have to setup intermediate processes to flatten the folders before moving the files. We'd also like to just drop the files into an interface folder for processing. Any other suggestions that could help on how to get the program to flatten folders on its own would be appreciated. If an option was created I'd put a futher rule to either overwrite duplicates or append a user determined numerical suffix on the file sequentionally to keep files unique. Thanks!
Merc
I've been running SBSE with much success but still wish to reiterate that there needs to be an option to allow folder flattening on the destination. We've found it too cumbersome to have to setup intermediate processes to flatten the folders before moving the files. We'd also like to just drop the files into an interface folder for processing. Any other suggestions that could help on how to get the program to flatten folders on its own would be appreciated. If an option was created I'd put a futher rule to either overwrite duplicates or append a user determined numerical suffix on the file sequentionally to keep files unique. Thanks!
Merc
- m3rc4ry
- Newbie

- Posts: 5
- Joined: Fri Jan 04, 2008 3:43 pm
I agree with the other members there really needs to be an option to copy all files from several source folders into a single destination folder.
How about the option then a BIG prompt window, warning you each time it's enabled. That's seems like a suitable solution to the reasoning behind the restriction in my opinion.
My reasoning is here:
http://2brightsparks.com/bb/viewtopic.php?t=5301
How about the option then a BIG prompt window, warning you each time it's enabled. That's seems like a suitable solution to the reasoning behind the restriction in my opinion.
My reasoning is here:
http://2brightsparks.com/bb/viewtopic.php?t=5301
-

bradavon - Expert

- Posts: 50
- Joined: Sun Feb 10, 2008 4:25 am
- Location: South West, England
A Small App to do just that
Here is a small application that will do exactly what you are looking for:
Consolidate Files from multiple directories. The only disadvantage is that it only works on the Mac...
Consolidate Files from multiple directories. The only disadvantage is that it only works on the Mac...
- SigSingh
- Newbie

- Posts: 1
- Joined: Tue Sep 23, 2008 3:44 am
Re: Copy from multiple folders into a single FTP folder
Came across this, but I don't know how well it works yet... Just discovered it.
http://lifehacker.com/5296664/suction-c ... s-into-one
http://lifehacker.com/5296664/suction-c ... s-into-one
- MarkSt
- Newbie

- Posts: 5
- Joined: Fri Sep 01, 2006 1:11 am
11 posts
• Page 1 of 1
Return to SyncBack V3 (freeware)
Who is online
Users browsing this forum: No registered users and 6 guests
