Skip to content

How to upload files to the ITHI server

Christian Huitema edited this page Nov 30, 2021 · 4 revisions

In this example, we assume that an organization participates to the ITHI project and wants to upload files captured at different server instances.

The organization will use a script to collect data from the server instances and then upload the data to ICANN. In this example, we make the following assumptions:

  1. The organization's login name on the ICANN server is example.
  2. The organization has installed the ssh client on the upload server.
  3. The scripts are run by the user name ithi on the upload server.
  4. The selected instances are listed in the file /var/ithi/instance-list
  5. At each instance, the capture files are placed in the folder /var/ithi/data/<instance_name>/
  6. The user ithi can use rsynch to gather files from each server instance

A server script could be:

#!/bin/sh

# set the local parameters
RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
KEY=/home/thisuser/cron/thishost-rsync-key 
ACCOUNT_LOCAL="ithi"
ACCOUNT_ITHI="ithi-example"
SERVER_ITHI="ithi.research.icann.org"
INSTANCES=`cat /var/ithi/instance-list`

# gather the local files from each isntance
for IX in $INSTANCES; do
$RSYNC -az -e "$SSH" $ACCOUNT_LOCAL@$IX:/var/ithi/data/$IX/ /var/ithi/data/$IX/
done

# upload to the ITHI server
$RSYNC -az -e "$SSH" /var/ithi/data/ $ACCOUNT_ITHI@$SERVER_ITHI:data/

The script could be launched using cron, with a crontab entry requesting to run it every day at a set time.