Thanks thargol,I'm not an expert on setting up FTP servers but...
Judging by the article you linked, setting local_root=/mnt/4TBHDD in the config file and restarting the ftp server might fix things. You'll also need to set appropriate permissions on that directory.
It appears that will restrict FTP users to the directory /mnt/4TBHDD on the server and, for ftp clients, that will be seen as /
I'm now at a position where I'm getting the files transferred by FTP from the cameras, and then transferring them by running the following script to their correct directories. but although it does move the files, it is putting them all into one directory (the ones for the named files, e.g RearGarden files all go to RearGarden directory on the HDD, and the same goes for the other two (FrontGates go to FrontGates, etc).
I am then left with empty directories in the original e.g directory 'o3' for March has '20','21','22' (which would have held the daily files for those directories) which are empty, I would like all these to have been moved across with the files.
Code:
#!/bin/bash# Source folderSOURCE_DIR="/home/pi/FTP/files/FrontGates/"# Destination folderDEST_DIR="/home/pi/mnt2/4TBHDD/FrontGates/" ###/home/pi/mnt2/4TBHDD/ is the MountPoint for my HDD.### ############ I commented this out as it did not seem to work at all? # Check if the device is mounted# if mountpoint -d "$MOUNTPOINT"; then # echo "USB drive already mounted" # exit 0 # fi # Mount the device # sudo mkdir -p "$MOUNTPOINT" # sudo mount -o defaults "$" "$MOUNTPOINT" # Copy files############################################## Move all files from source to destinationfind "$SOURCE_DIR" -type f -print0 | while IFS= read -r -d $'\0' file; do mv "$file" "$DEST_DIR"doneWD
Statistics: Posted by double-udee — Wed Mar 26, 2025 11:46 am