Skip to content

Rsync and Checksum

dickgroenenberg edited this page Mar 17, 2022 · 1 revision

Rsync

Preferably use rsync rather than scp to copy large datases between instances.
Rsync is faster, copies with guarantee and is just as safe (use SSH).

rsync -av -e "ssh -i private_key" source_data ubuntu@###.###.###.###:/destination

(the above command assumes presence of the public key within .ssh/auhthorized keys on the remote server)

Checksum

Checksum works only on files, not folders, but you can archive a folder on the fly
(it won't be saved) and subsequently checksum.

tar c "foldername" | md5sum

Having identical folder contents (all files within having identical checksums between local and remote)
not necessarily means that folder checksums will be identical (e.g. due to different file-systems or block sizes)

After the obvious first check to compare file size, checksumming all files (especially those that are acouple of
Gbs large) can take a long time. As for the blast-databases, to get a quick indication only the checksum of the
smaller files (e.g. those with nog-extension) could be obtained:

md5sum $(find $directory -type f -name \*.nog) | awk '{print $2,$1}' | sort -n | column -t

In the case of the blast-databases, run the above command from the top ('output') directory. The find command
recursively looks for *.nog files and the subsequent awk, sort and column statements allow for easy comparison
(sorting order can differ between local and remote).

Clone this wiki locally