1. Knowledge Link
  2. Estimating Link Online

Cloud Link Timed Backup to off-site directory

Step by step instructions to automate this process using a simple script and Windows Task Scheduler.

Introduction

The Construction Link, Inc. does internal backups of Estimating link for Cloud Link the customers, but some customers would prefer to have on-premise backup in case of service interruption or internet outages.

As a best practice, we recommend that our Cloud Link customers back up Estimating Link projects.  One way to do it is to automate backups of Estimating Link projects via NAS (Network-Attached Storage) or cloud storage platforms (i.e. Google Drive, OneDrive, Dropbox, and similar services). This ensures that users always have a recent backup of their important projects.

Backing up your data regularly provides several critical benefits

  • Business Continuity: Regular backups support business continuity by minimizing downtime. In the event of a disaster or significant data loss, you can restore operations quickly, maintaining productivity and service delivery to your customers.
  • Peace of Mind: Knowing that your data is regularly backed up provides peace of mind. It reduces the stress and worry associated with potential data loss, allowing you to focus on your core activities without the constant fear of losing valuable information.
  • Flexibility and Mobility: With backups, you can access your data from different locations and devices. This is particularly useful for remote work scenarios or when you need to transfer data to a new system.

By implementing a robust backup strategy, you not only safeguard your data but also ensure that your business operations remain resilient and adaptable to any unforeseen challenges.

Additionally, Cloud Link customers have the option to download Estimating Link locally.  By downloading Estimating Link and automating Cloud Link backups, customers gain the benefit of uninterrupted access to their program and files, even if our cloud service experiences downtime. This dual setup not only provides peace of mind but also enhances productivity by ensuring that critical data is always accessible. In the event of any service disruptions, having a local copy of both the software and the backup files means you can continue your work seamlessly without any delays. This combination of cloud convenience and local reliability offers the best of both worlds, making your data management more resilient and secure.

Fortunately, you can automate this process. This guide will walk you through creating a script to back up your files and setting up a scheduled task to run this script automatically.

Here's a quick overview of what you'll do:

  1. Create a Script: You'll write a small program in Notepad that tells your computer which files to back up and where to save them.
  2. Save the Script: You'll save this program as a .VBS file, which is a type of script that Windows can run.
  3. Set Up Task Scheduler: You'll use Task Scheduler, a built-in Windows tool, to set up a task that runs your script automatically.
  4. Configure the Task: You'll set the task to run every time you log on to your computer and to repeat every hour, making sure the task stops if it runs too long.

It will run when a user logs in, and every hour after that. It will only copy .CLI files (though adding .BAK files is easy), and only those that have changed since the last run (it uses the Archive bit on a file, only files with attribute A, after backing up, it resets the attribute to N).

By the end of this process, your computer will automatically back up your files every hour without you having to lift a finger. This ensures that your important data is always safe and up-to-date. Let's get started!

Notes

  • For users with large backup directories, it will take a while to do the first backup.  After that, only new or modified files will be copied.
  • It would need to be done for each user, and it is highly recommended the target be a common location for all users.

Step 1

Create a .BAT (batch) file to run a backup by writing a script that automates the process.

  1. Open Notepad:
    • Click on the Start menu.
    • Type Notepad and press Enter.
  2. Write the Backup Script by copying, pasting and editing the below:
    • @set source="C:\Program Files (x86)\Construction Link\Estimating Link V3\Backups\"
      @set dest="D:\path\to\your\backup\folder"

      xcopy %source%*.cli %dest% /M /Y 
    • Replace D:\path\to\your\backup\folder with the path to the folder where you want to save the backup, as shown below:
  3. Save the file as a .BAT File:
    1. Click on File in the Notepad menu.
    2. Select Save As.
    3. In the Save as type dropdown, select All Files.
    4. Name your file CLI_Backups.bat.  (make sure to include the .bat extension).
    5. Choose a location to save your file (e.g., Desktop).
    6. Click Save.
  4. Run the .BAT File:

    • Navigate to the location where you saved the Timed Estimating Link Backup.bat file (e.g., Desktop).
    • Double-click the Timed Estimating Link Backup.bat file to run it.
  5. Check the Backup:
    1. After running the batch file, go to your destination folder (e.g., D:\path\to\your\backup\folder).
    2. You should see a new folder with the timestamp of the backup containing all the files and subfolders from your source folder.

Step 2

Create a .VBS (Visual Basic Script) to execute the above batch file.

  1. Open Notepad:

    • Click on the Start menu.
    • Type Notepad and press Enter.
  2. Write the Backup Script by copying and pasting the below (this allows the script to run hidden so it does not flash when running):
    • CreateObject("WScript.Shell").Run chr(34) & "C:\users\USERNAME\cli_backup.bat " & Chr(34), 7
    • Replace USERNAME with your username:
  3. Save the File as a .VBS File:
    • Click on File in the Notepad menu.
    • Select Save As.
    • In the Save as type dropdown, select All Files.
    • Name your file backup.vbs (make sure to include the .vbs extension).
    • Choose a location to save your file (e.g., Desktop).
    • Click Save.
  4. Run the .VBS File:
    • Navigate to the location where you saved the backup.vbs file (e.g., Desktop).
    • Double-click the backup.vbs file to run it.
  5. Check the Backup:
    • After running the script, go to your destination folder (e.g., D:\path\to\your\backup\folder).
    • You should see a new folder with the timestamp of the backup containing all the files and subfolders from your source folder.

Step 3

Create a scheduled task that runs your backup script by using the Task Scheduler in Windows.

  1. Open Task Scheduler:

    • Click on the Start menu.
    • Type Task Scheduler and press Enter.
  2. Create a Basic Task:
    • In the Task Scheduler window, click on Create Basic Task... in the right-hand Actions pane:
    • Name the task Timed Estimating Link Backup:
    • Click Next.
  • Set the Trigger
    • Select When I log on as the trigger for the task:
    • Click Next.
  • Set the Action:
    • Select Start a program as the action:
    • Click Next.
    • In the Program/script field, type the path to your VBS file (e.g., C:\Users\USERNAME\cli_backup.vbs):
    • Replace USERNAME with your actual Windows username.
    • Click Next.
  • Finish Creating the Basic Task and review the settings:

    • Add a check mark to Open the Properties dialog for this task when I click Finish.
  • Click Finish.
  • The Estimating Link Timed Back Properties window will appear.  Select the Triggers tab, highlight the trigger:
    •  
    •  Click Edit.  The Edit Trigger window will appear:
      • In the Advanced Settings section, add a check to Repeat task every: and use the drop down arrow in the field to select 1 hour.
      • Add a check mark to Stop all running tasks at end of repetition duration.
      • Add a check mark to Stop task if it runs longer than: and use the drop down arrow to select 30 minutes
      • Click OK.

Notes:

  • Ensure that your VBS file path is correct and accessible.
  • You may need to provide administrative permissions to create and modify scheduled tasks.

By following these steps, your backup script will run every time you log on and then repeat every hour, with each instance stopping if it runs longer than 30 minutes.