Hi
I run transmission on a Ubuntu 20.04 machine. I store all the downloads on a pair of 2 T HDD attached to this dedicated machine. When a download is complete I would like the script to copy not move the file to a network attached HDD. The network drive is available via SAMBA. Yes this means every download will reside in 2 locations, one local to transmission and one on the network. I have asked this same questions on a few different forums and always get the same answer save it to the network drive directly. This is not want I want to do. The network drive is accessed by a NAS which in turn can be accessed by the various computers in the house. They do not have access to the machine transmission is on.
Script for Ubuntu to copy files to another dir after they complete.
Re: Script for Ubuntu to copy files to another dir after they complete.
First, mount your remote SAMBA drive and then modify and use Unrar and cleanup script to copy/move/unrar to your locally mounted network drive. Ask specific scripting questions at the post I linked to.
Re: Script for Ubuntu to copy files to another dir after they complete.
That really does nothing for me I am not trying to un rar any files. I just want to move the finished file. The drive is never not mounted.
Re: Script for Ubuntu to copy files to another dir after they complete.
Ok. This contradicts the files being on your local drive and on your network drive. Sure it is/was/will be.
On Debian your script could look something like:
Code: Select all
#! /bin/bash
# posttorrent.sh by Killemov
{
SRC_DIR="${TR_TORRENT_DIR}/${TR_TORRENT_NAME}"
cp -rupa "$SRC_DIR" /my/mounted/network/dir/
} &
Re: Script for Ubuntu to copy files to another dir after they complete.
thanks will test and let u know