I created an lftp script to upload individual files to a web hosting provider.
The use case is that I call it from the root of the repository, so the relative path here is the same on the remote server.
#!/bin/bash DIRNAME=$(dirname $1) FILENAME=$(basename $1) REPO_ROOT=$(pwd) ABSOLUTE_PATH=${REPO_ROOT}/$1 lftp -u user,passwd -p port sftp:// user@hosting <<EOF cd $DIRNAME put $ABSOLUTE_PATH ls -l $FILENAME quit 0 EOF
It works with one small but annoying mistake. To check if it really loads the file, I put ls -l at the end. It fails, and I do not understand why:
ls: Access failed: No such file(functions.php)
I tried to use rels and cache flush , but in vain. I am using lftp 4.0.9.
source share