LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-08-2017, 03:22 AM   #1
kcdxb
LQ Newbie
 
Registered: May 2017
Posts: 1

Rep: Reputation: Disabled
LFTP Tweaks script


Hello, I have been using LFTP for a year now in the form of a script,

I would be grateful should you be able to help with one thing,

I would like LFTP to mirror only once the folder and not do it all the time,
Also I would like to have LFTP mirror multiple folders and also to have an extension added to the file its downloading so sonarr and radarr in particular doesn’t add them to their library before their completed.
Also I would like to log to tell me more about the process,

Here is a copy of my script
Regards,
KC

Code:
#!/bin/bash

login="user"
pass="password"
host="server.com"
remote_dir='/path1/deluge/data/completed/movies-couch'
local_dir="/local path1"

base_name="$(basename "$0")"
lock_file="/tmp/$base_name.lock"
trap "rm -f $lock_file" SIGINT SIGTERM
if [ -e "$lock_file" ]
then
    echo "$base_name is running already."
    exit
else
    touch "$lock_file"
 	/usr/local/bin/lftp -p 22 -u "$login","$pass" sftp://"$host" << EOF
    set xfer:temp-file-name yes
    set sftp:auto-confirm yes
    set mirror:use-pget-n 10
    mirror -c -P10 --log="/var/log/$base_name.log" "$remote_dir" "$local_dir"
    quit
EOF
    rm -f "$lock_file"
    trap - SIGINT SIGTERM
    exit
fi
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lftp with progress bar in a script bittus Linux - Server 5 11-03-2018 10:59 AM
bash script to lftp mirror and log zimbot Linux - General 6 09-23-2013 07:55 AM
Testing for lftp transfer result (in bash script) nauliv Linux - Software 2 03-12-2013 10:41 AM
[SOLVED] Silly mistake in lftp bash script probably quotes emmalg Linux - Software 3 02-08-2013 05:12 AM
lftp remote server du -sh + mail script sappi Programming 3 07-28-2012 08:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration