Script for Ubuntu to copy files to another dir after they complete.

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
kanaske
Posts: 11
Joined: Sat Sep 05, 2020 10:01 am

Script for Ubuntu to copy files to another dir after they complete.

Post by kanaske »

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.
killemov
Posts: 533
Joined: Sat Jul 31, 2010 5:04 pm

Re: Script for Ubuntu to copy files to another dir after they complete.

Post by killemov »

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.
kanaske
Posts: 11
Joined: Sat Sep 05, 2020 10:01 am

Re: Script for Ubuntu to copy files to another dir after they complete.

Post by kanaske »

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.
killemov
Posts: 533
Joined: Sat Jul 31, 2010 5:04 pm

Re: Script for Ubuntu to copy files to another dir after they complete.

Post by killemov »

kanaske wrote: Sat Feb 27, 2021 3:38 pm 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.
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/
} &
kanaske
Posts: 11
Joined: Sat Sep 05, 2020 10:01 am

Re: Script for Ubuntu to copy files to another dir after they complete.

Post by kanaske »

thanks will test and let u know
Post Reply