Rename file via scripted FTP

Here’s an lftp script to rename a remote file vi FTP without downloading the file:

#!/bin/bash

NAS_HOST=myhost
NAS_USER=myuser
NAS_PASS=mypass

SRC=$1
DST=$2

lftp -c "open -e \"mv $SRC $DST\" -u $NAS_USER,$NAS_PASS $NAS_HOST"
blog comments powered by Disqus