Automatically move files to Backup folder

This tutorial will show how to monitor folder for incoming files and move them automatically to folder with current date in its name.

Suppose that at the end of every working day all employees are uploading their daily reports to network share. The folder shared on the network has path C:\Report\ on local computer. Upon arrival to the share, these documents are to be moved to D:\Backup\ folder where later have to be retrievable by the date of their backup.

Let us list the necessary steps:

  1. The creation of the Task itself.
  2. Adding a Trigger which will watch folder C:\Reports\ for new files and launch the Task when one arrives.
  3. Adding an Action which will copy newly arrived file to the backup folder containing current date in its name.

How to create a Task in Automation Workshop? Creating a Task is easy. Just open the Automation Workshop manager and choose New Task from File menu. This will bring forward the Task Wizard - a step by step configuration tool for setting up the Task parameters (including adding and configuring both Triggers and Actions).

How to watch folder for new files? In Task Wizard, go to the Trigger tab and click the Add button (this will open Add Trigger window). Select File / Folder Watcher Trigger and click OK. We are automatically brought to File / Folder Watcher Folder properties where we can configure the conditions upon which the Trigger will execute the Task.

Folder watcher - monitor folder C:\Reports

First, we need to specify which folder will be monitored. Click on Folder to watch input line and then on the Browse button on the right side of it. Select the Reports folder on drive C: and click OK. Now Folder to watch input line contains C:\Reports. All other settings suit our Task by default. The newly added File / Folder Watcher Trigger will monitor for all new files appearing in C:\Reports folder without filtering out any files. Just click OK at this point to save Trigger settings and return to the Task Wizard.

How to automatically move files to backup folder? Now we have to add an Action that will move files when triggered. Go to the Actions tab of Task Wizard (next step after Triggers section) and click Add button (this will open Add Action window). Choose Move File Action from File / Folder category and click OK.

Now we are in the File tab of Move File Action properties. Here we have to specify the most important settings, namely, what will be moved (source) and to where exactly (destination).

Let us start with source. We will not specify Move File Action to move just some files located in some folder. Instead, we will move exactly those files that are found by File / Folder Watcher Trigger (added in the previous step). Click on the Variable Wizard button (to the right from Source input line). The list of Variable categories will be opened. We need to take parameters from a Trigger, so we click on the Triggers category and choose File / Folder Watcher: C:\Reports (watch for new files). The default option on the right side, namely, Full path and filename fits perfectly to specify both path and file name for automatic moving operations. Click OK and see Filename in Source input line.

Now let us specify the destination. We need not only to move all files to folder D:\Backup\, but also to create a subfolder for each day. First let us click on Destination input line and then on Browse button. Select Backup folder on drive D: and click OK, which will result in D:\Backup\ appearing in Destination input line.

Now, how can we tell Automation Workshop to automatically put files into folder that has current date in its name? For such varying parameter we will need to use Variable Wizard again. While cursor is still in Destination input line (after D:\Backup\) click on the Variable Wizard button. Since we need to add current date, let us choose the Date variable from Date / Time category. The default format is Month / Day / Year separated by slashes. However, for current purposes this format is not appropriate, since we can not have slashes in file names. Dots in file name specify extensions and can be used in principle. However, it is a much better idea to choose dash as a file system neutral character.

Variable Wizard - Date - Year-month-day

Also, it will be more convenient to see all folders in sequential order when browsing D:\Backup folder, that is why it is better to choose Year - Month - Day format. Also, check the Add leading zero option to avoid problems with sorting order between dates / months that contain single digit and those with two digits (e.g. 1, 10, 11, 12, 2 vs. 01, 02, 10, 11, 12 sorting order). When configured, click OK and you will see D:\Backup\Date in Destination input line. Finally, in order to specify that Date refers to folder (and not to file name), manually add backslash character at the end of Destination input line. The final content of the input line, thus, has to be: D:\Backup\Date\ folder.

Move file Action - D:\Backup\Date\

Unless you would like to filter out some files based on their names, extension, attributes or time, click OK. The Move file Action is configured and the Task is ready to start the daily backups. Just check the reporting options, give Task a name (Task tab) and click Finish to save settings and activate the Task.

From now on, whenever a new file appears in C:\Report\ folder, File / Folder Watcher will automatically move it to folder containing the current date in its name located in D:\Backup\ (if non-existent, the folder will be created during automatic file moving operation).

Let us consider the following scenario:

  1. On August 18th, 2011 the file daily report.doc is put into C:\Reports\ folder. The file is removed from C:\Reports\ and put into newly automatically created folder with the date in its name which itself is located in the D:\Backup\ folder. Now there is daily report.doc file in D:\Backup\2011-08-18\ folder.
  2. On the same day (August 18th, 2011) a file named weekly report.doc is put into C:\Reports\ folder. The file is removed from C:\Reports\ and put into previously created folder with the date in its name located in the D:\Backup\ folder. Now there are both daily report.doc and weekly report.doc files in D:\Backup\2011-08-18\ folder.
  3. On the same day (August 18th, 2011) a file with the same name as the one already in today's backup (weekly report.doc) is put into C:\Reports folder. Since Move File Action does not overwrite destination files by default, the weekly report.doc will remain in C:\Reports\ folder. The weekly report.doc file already in today's backup folder D:\Backup\2011-08-18\ will not be overwritten. A corresponding error message will be logged. Note: If Overwrite destination files option is enabled in Options tab of Move File properties, the weekly report.doc file already in D:\Backup\2011-08-18\ folder will be overwritten with the new weekly reports.doc file which was put in C:\Reports\ folder more recently.
  4. A file with the same name (weekly reports.doc) as the day before is put into C:\Reports folder on the next day (August 19th, 2011). Since files are moved to different backup folder each day, the file moving process will not be affected by existence of the file with the same name in different folder. In this case, weekly reports.doc will just be moved to D:\Backup\2011-08-19\ without regard to contents of D:\Backup\2011-08-18\ folder.
Windows Explorer - Backup folder - Year, month, day

How to setup hourly backup folders instead of daily ones? If we wanted to create backup archive on hourly basis instead of daily one, we would need to add hour value to destination folder specification.

Variable Wizard - Date / time component - Hours (24)

To modify already existing setup, go to the File tab of Move File Action properties, put a cursor at the end of the Destination input line, just after D:\Backup\Date\ and click on Variable Wizard button. Choose Date / Time component from Date / Time category. Select Hours (24) on the right side. The hour value is chosen in 24 hour format to enable easier folder sorting afterward. Click OK to return to the File tab of Move File Action. Add backslash character after D:\Backup\Date\Date to specify that the destination will be a folder, not file. The final content of the Destination input line, thus, will be: D:\Backup\Date\Date\ folder.

Move file Action - D:\Backup\Date\Date\

With this setup, the backup folder of each day will contain subfolders with hour number in their names. Or, the other way around, an hour subfolder will be created for each hour when a file is moved from C:\Reports\ to backup folder.

For example, if some files are moved on August 18th, 2011 at the following times 10:12AM, 1:27PM and 3:59PM, the respective subfolders 10, 13 and 15 are created in D:\Backup\2011-08-18 folder.

Move file Action - D:\Backup\Date-Date\

Alternatively, instead of using D:\Backup\Date\Date\ destination, it is possible to specify D:\Backup\Date-Date\ folder as Destination. As a consequence, there will be no hourly subfolders for each date, but hourly folders containing Year-Month-Day-Hour in their names (e.g. D:\Backup\2010-07-15-10\).

Windows Explorer - Backup folder - Year, month, day, hour

In this case, if some files are moved on August 18th, 2011 at the following times 10:12AM, 1:27PM and 3:59PM, the 2011-08-18-10, 2011-08-18-13 and 2011-08-18-15 respective folders are created in D:\Backup folder.

Free trial 15 day trial · Details…
Buy now 30 day MBG · Details…

If you have any questions, please do not hesitate to contact our support team.

© 2001–2017 Febooti Ltd.