#!/bin/bash LOCAL_TORRENT_DIR="/Users/Sajuuk/Downloads/" NETWORK_TORRENT_DIR="/Volumes/public/.torrents/" #---------------------------------------------------------------------------------- LOCAL_TORRENT_DIR=$LOCAL_TORRENT_DIR find $LOCAL_TORRENT_DIR -name \*.torrent -exec cp {} $NETWORK_TORRENT_DIR \; value="$?" # get response from cp command if [ "$value" == "0" ] # if error recived then find $LOCAL_TORRENT_DIR -name \*.torrent -exec rm {} \; # remove copied files #echo "remove files" fi