Skip to content

Instantly share code, notes, and snippets.

@roman-4erkasov
Last active June 2, 2023 12:58
Show Gist options
  • Save roman-4erkasov/236894e8430a5c6343d8bfa78c99e402 to your computer and use it in GitHub Desktop.
Save roman-4erkasov/236894e8430a5c6343d8bfa78c99e402 to your computer and use it in GitHub Desktop.
PID=123
path=/home/user123/file.txt
while test -d /proc/$PID; do
hdfs dfs -put -f "$path"
echo "[$(date '+%Y-%m-%d %H:%M:%S')] synced from $path, waiting for 1h...";
sleep 1h
done
echo "Sync $path"
sleep 1h
hdfs dfs -put -f "$path"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment