sync()

Read(271) Label: nodes, synchronize,

Description:

Synchronize the nodes.

Syntax:  

sync(hd:hs,p;zs)

Note:  

The function synchronzies file directories p in partition list zs on the nodes holding the processes specified by parameter hs onto the same directories in zs on the nodes holding the processes specified by parameter hd. The synchronization is performed according to the last time the files are updated, thus extra file will be deleted and time will be checked. If there are namesake files in the same partitions, synchronize hd by those with the latest update time. Perform the synchronization on the local machine if parameter hs and hd are absent; synchronize all files if parameter p is absent; and find the files under the nodes’ main directories if parameter zs is absent.

Parameters:

hd

A sequence of processes

hs

A sequence of processes

p

The file directories in the partition list on the nodes holding processes parameter hs specifies

zs

A data partition named after an integer. The parameter is a sequence when there are multiple partitions.

Example:

 

 

A

 

1

=sync(["192.168.1.100:8081","192.168.1.101:8283"]:"192.168.0.99:9281";1)

Synchronize data partition 1 on the node "192.168.0.99:9281" to the data partition 1 on both the nodes "192.168.0.100:8081" and "192.168.1.101:8283"

2

=sync(["192.168.1.100:8081","192.168.1.101:8283"]:"192.168.0.99:9281")

Synchronzie all data partitions on the node "192.168.0.99:9281" to the data partitions on both the nodes "192.168.0.100:8081" and "192.168.1.101:8283"

3

=sync(["192.168.1.100:8081","192.168.1.101:8283"]:"192.168.0.99:9281","f1")

Synchronize folder “f1” under the main directory on the node "192.168.0.99:9281" to the main directory on both the nodes "192.168.0.100:8081" and "192.168.1.101:8283"

4

=sync(["192.168.1.100:8081","192.168.1.101:8283"]:;1)

Synchronize data partition 1 on the local machine to data partition 1 on both the nodes "192.168.0.100:8081" and "192.168.1.101:8283"

5

=sync(:"192.168.0.99:9281";[1,2])

Syncronize data partitions 1 and 2 on the node "192.168.0.99:9281" to the same data partitions on the local machine

6

=sync(["192.168.1.100:8081","192.168.1.101:8283"]:"192.168.0.99:9281",”t1”;1)

Synchronize the folder “t1” in partition 1 on the node "192.168.0.99:9281" onto the corresponding folder in partition 1 on node “192.168.0.100:8081” and node “192.168.1.101:8283”