File replicator

The LANDesk file replicator is a utility designed to replicate files from a remote Web server to the local system. It provides the following features:

Your Web server must be configured properly for the file replicator to work:

Using the file replicator

The file replicator copies files from Web sites or Web shares to a folder you specify. You can create periodic repeating tasks or single tasks that run on a schedule you specify. The file replicator uses the same HTTP transfer technology that Management Suite uses for software distributions. You can limit the transfer bandwidth by kilobytes per second or by a percentage of available bandwidth.

Management Suite setup copies the file replicator to this folder:

The replicator is a standalone Windows application and you can copy the File Replicator folder and subfolders to any server you want. If you want to access the online help, also copy ldms.chm to the same place. The default .NET Framework security configuration won't allow the file replicator to launch from a remote path. If you try to run the program remotely, nothing will happen.

To configure a replication task, you need to provide the following:

The file replicator caches files in the Temporary folder box. Once the copy finishes to the temporary directory, the replicator copies the file to the destination and deletes it from the temporary directory. This prevents partial copies from ending up on the destination if the file copy from the source is interrupted for some reason.

The file replicator stops whatever it's doing when it's opened. When you're done with the window, make sure you click Start download. This minimizes the replicator to the system tray and allows replication tasks to execute.

The file replicator configuration file, stored in XML format, needs to be created before you can do any replication tasks. There is no default XML configuration file. This XML configuration file can be the same or different on each server.

If the user logs off, the file replicator process in the system tray terminates. Usually with servers, file replicator must be launched when a user is not logged in. This can be done using Microsoft’s Task Scheduler service or LANDesk’s Local Scheduler service, as described in Scheduling replication from the command line.

To create a replication task
  1. Launch the file replicator (\Program Files\LANDesk\ManagementSuite\Utilities\File Replicator\LANDeskFileReplicator.exe).
  2. From the New button's menu, click New periodic task or New single task.
  3. Enter a task Name.
  4. Enter or browse to the Destination folder.
  5. Enter or browse to the Temporary folder.
  6. Set the time you want the replication task to occur. If the task doesn't finish in the time allowed, it will resume from the point it left off the next time the task runs.
  7. Select the bandwidth options you want. You can specify a value in kilobytes per second, a percentage of available bandwidth, or none.
  8. Click Add to enter source URLs. The address must be in the form of http://server/path. If necessary, specify the credentials necessary to access the URL. When you're ready, click Browse. If the URL and credentials work, you'll see the destination in the lower half of the dialog box. Check Download recursively if that's what you want. Click OK when you're done.
  9. Repeat step 8 for each URL you want to replicate.
  10. Click Save when you're done.
  11. When you're done configuring tasks, click Start download to activate file replication on the schedule you specified. The file replicator minimizes to the system tray.

The file replicator stores a log of its actions.

To view the file replicator log
  1. Launch the file replicator.
  2. Click the View log toolbar button.

You can reschedule a single task. This resets the task so it will run again.

To reschedule a task
  1. Launch the file replicator.
  2. Select the single task you want to reschedule.
  3. Click the Reschedule task toolbar button.

Understanding the bandwidth options

The file replicator uses bandwidth options to make sure replication doesn't saturate a device's available bandwidth. Any bandwidth options you specify apply to the device the replicator is copying files from, not the destination. There are two bandwidth options the replicator can use:

Bandwidth options are set on a per-job basis. If you have multiple file replication jobs active at once, the job bandwidth settings can interact. For example, if you have one job that's allowed 100 KB/sec second, and another that's allowed 50 KB/sec, the total bandwidth used if the two jobs are active at the same time will be 150 KB/sec. With percentage of available bandwidth, it's slightly more complicated. If you have two jobs that are allowed 50% of available bandwidth, the total bandwidth used by both jobs won't exceed 50% of the total. Each job will end up with about 25% of the available bandwidth.

Scheduling replication from the command line

Management Suite ships with two file replicator versions:

The graphical and command-line file replicators use the same XML-format configuration file. Before using the command-line file replicator, you need to use the graphical file replicator to create an XML configuration file.

The following is the syntax for LANDeskFileReplicatorNoUI.exe:

LANDeskFileReplicatorNoUI.exe configfile [logfile]

Here is an example:

LANDeskFileReplicatorNoUI.exe LDHTTPCopyTaskConfig.xml replicator.log

The following sections describe to ways you can schedule LANDeskFileReplicatorNoUI.exe from the command-line.

The examples in the steps below assume that each package server has two hard drives: the C drive for the operating system; and the D drive for data storage. It also assumes that each server is configured to have a web share named Packages that has a local path of D:\Packages.

Scheduling replication using the Management Suite Local Scheduler service

The Management Suite Local Scheduler service is installed with the Management Suite agent configuration. The file used is LocalSch.exe. If your server isn't managed by Management Suite, this service won't exist and you'll have to use the Microsoft task scheduler instead. For more information on the local scheduler, see Using the local scheduler.

Once you've copied the file replicator files and XML configuration file to your server, enter the following at a command prompt to schedule replication to occur every 20 minutes: 

"%programfiles%\LANDesk\LDClient\LocalSch.exe" /taskid=1 /freq=1200 /exe="%ProgramFiles%\LANDesk\ManagementSuite\Utilities\File Replicator\LANDeskFileReplicatorNoUI.exe" /cmd="""%ProgramFiles%\LANDesk\ManagementSuite\Utilities\File Replicator\LDHTTPCopyTaskConfig.xml"" ""%ProgramFiles%\LANDesk\ManagementSuite\Utilities\File Replicator\replicator.log"""

Note that the three quotes after /cmd= in the examples below is not a mistake. Three quotes are required to handle parameters that include quotes themselves. 

To change the launch interval, change the /freq= parameter's value to the number of seconds you want. In the example above, 1200 seconds equals 20 minutes.

To verify that a task was created, run the following command:

"%programfiles%\LANDesk\LDClient\LocalSch.exe" /tasks |more

Scheduling replication using the Microsoft Task Scheduler service

You can also control Microsoft's task scheduler from the command-line with the SCHTASKS command. SCHTASKS can schedule LANDeskFileReplicatorNoUI.exe to run almost any time.

For more information on SCHTASKS, see:

Once you've copied the file replicator files and XML configuration file to your server, do the following to schedule replication to occur at the interval you want (the example below uses every 20 minutes).

To schedule replication every 20 minutes with Microsoft's task scheduler
  1. In the %ProgramFiles%\LANDesk\File Replicator directory, create a batch file called “File Replicator.cmd” that contains the following line.

    "%ProgramFiles%\LANDesk\ManagementSuite\Utilities\File Replicator\LANDeskFileReplicatorNoUI.exe" "%ProgramFiles%\LANDesk\ManagementSuite\Utilities\File Replicator\LDHTTPCopyTaskConfig.xml" "%ProgramFiles%\LANDesk\ManagementSuite\Utilities\File Replicator\replicator.log"

  2. Open a command prompt on the package server by clicking Start > Run and typing CMD.
  3. Enter the following command.

    schtasks /create /ru system /sc minute /mo 20 /tn "File Replicator every 20 minutes" /tr "%ProgramFiles%\LANDesk\File Replicator\File Replicator.cmd"

    Note: The commands should be entered as a single command line.

  4. To verify that the task was created, run SCHTASKS with no parameters and the task details are displayed.

If you want to schedule hourly replication, change the schtasks command line above to the following:

If you want to schedule daily replication, change the schtasks command line above to the following: