Shows how to create a Mimic managed collection from an existing set of files.

Suppose you have an existing collection of files located at /my/data. To initialize the collection for mimic management you need to make /my/data you default directory with:

cd /my/data

Then have mimic create its management files with (-v option is for verbose mode)

mimic-init -v

Then add all the files in the folder and sub-folders (-r option does a recursive add)

mimic-add -v -r .

Now suppose you would like to mimic all the files to the host "my.remote.host.com". The account you would like to use on "my.remote.host.com" is "dda" and you would like the to refer to the task by the name "my-remote". The following with create the task:

mimic-config -v -d Push -t my-remote -u dda -i scp://my.remote.host.com/my/data

To push the data to the remote use the command

mimic-push -v -t my-remote

Since the task is defined to use the "scp" protocol you will need to install your public certificate on my.remote.host.com under the "dda" account. To create a ssh key pair create a directory in the root folder your local account and make sure the permissions only allow the owner to read or write.

mkdir .ssh
chmod 700 .ssh

Create the public/private key pair in the ".ssh" directory with the commands

cd ~/.ssh
ssh-keygen -t rsa

Do not enter a passphrase. This will eliminate any prompting when using the keys

Now copy the public key (*.pub) to the remote system and place it in the file "authorized_keys" in the ".ssh" directory of the user account you will login as. If the file "authorized_keys" exists, concatenate the public key to the file.

cat .ssh/id_rsa.pub | ssh -l {remote-user} {remote-host} 'cat >> .ssh/authorized_keys'

You will need to enter the password for the {remote-user} in order to complete the copy. After the public key is installed you will no longer be required to enter a password.

That's it!

You're now ready to synchronize files. You can run the "mimic-push" any time like

mimic-push -t my-remote

Since it's a command-line tool you can also include it in scheduled tasks (like cron) to automatically keep the copies synchronized. You can also have multiple destinations and if you run mimic-push without a task name it will run all push tasks.