The example script below can be used to sync the entire $USER
home-folder with the (<gdrive>:Research/
) directory, where gdrive is the name we assigned locally when we set up rclone to work with the external directory.
This script needs to be invoked (i.e. by calling sbatch rclone_sync.sh
) every time you want to sync to the external drive. This differs from the desktop client, which syncs continuously.
#!/bin/bash
#SBATCH --mem=8000
#SBATCH --time=96:00:00
#SBATCH -e sync_logs/latest.err
#SBATCH -o sync_logs/latest.out
# ensure that the rclone module is loaded:
module load hurcs rclone
#source directory or directory to SYNC
source_dir=/sci/home/$USER/
#drive location to sync to
rclone_dest=gdrive:Research/
#log path:
log_path=sync_logs/rclone_$(date +%Y_%m_%d_%H:%M:%S).log
#drive sync
#add --dry-run for a test run
rclone sync \
--cache-rps 50 -v --tpslimit 10 \
--checkers 8 --transfers 4 \
$source_dir $rclone_dest 2>&1 | tee $log_path