Hey Guys,
First time poster. Go easy on me:)
So I have a simple script that runs every 30 seconds per a time scheduler. This script and scheduler run as expected.
Here is the .timer file and the bash script linked to the timer:
[danielh@turin system]$ cat port_to_plex.timer
[Unit]
Description=Timer for port_to_plex
[Timer]
OnBootSec=15min
OnUnitActiveSec=30s
[Install]
WantedBy=multi-user.target
[danielh@turin scripts]$ cat port_to_plex.sh
#! /bin/bash
rsync -rt --remove-source-files /home/danielh/port/* danielh@172.16.100.108:/data/port
find /home/danielh/port/ -mindepth 1 -maxdepth 1 | xargs rm -rf
[danielh@turin scripts]$
Now, the goal of this script is simple. On a routine basis, move files from a local directory to a remote directory (my plex server which is running rsync and arch/manjaro).
The issue I am having is that if I move a big file to this folder, and if the script runs at the same time the file is still being moved, rsync will move the file anyways… essentially stopping the transfer and then moving a half formed/moved file.
Any ideas or better ways to go about doing this?
Thanks for any suggestions or help ahead of time~