problem with dietpi-sync and FTP (resolved)

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
charlyb9978
Posts: 3
Joined: Tue Feb 27, 2018 9:18 pm

problem with dietpi-sync and FTP (resolved)

Post by charlyb9978 »

Hello,

First excuse me for my english, i'm a french guy who speak english like a spanish cow...

I'm a new (happy) user of dietpi. Before explain my problem, i explain my configuration: i have 3 raspberry pi:
- rpi n°1: it's a RPI3 with jeedom (french home automation) on raspbian
- rpi n°2 : its a rpi3 with nextcloud, kodi and a ftp server. I use a Pidrive and dietpi for this one
- rpi n°3: it's a rpi2 with dietpi and a pidrive . I use it to do a reverse proxy (nginx) and a backup of dietpi-userdata of the rpi n°2 (Video, music, photos and nextcloud files). So with a ftp server too...

So i want use diet-sync on rpi n°2 to send files and folders to rpi n°3 via ftp client, and this is the problem....doesn't work...
For test i try with a single folder ("test1") with one image ("yoga.jpg"):
- if i try a local sync between mnt/folder1 and mnt/folder2 on same rpi n°2, it's OK no problem.
- if i try a sync with FTP option, the folder (test1) is create on ftp-client of rpi n°2 and on the sync-folder of rpi n°3 but not the files (yoga.jpg), neither in the ftp-client of the rpi n°2 nor in the sync-folder of rpi n°3.

When i look the log, i understand that it's access permission problem on ftp-client but i 'm not a specialist ( i 'm better with a guitar than with linux computer...)

the log of dietpi-sync:

Code: Select all

2018/02/27 21:09:13 [12890] building file list
2018/02/27 21:09:13 [12890] rsync: chgrp "/mnt/ftp_client/dietpi-sync/." failed: Operation not permitted (1)
2018/02/27 21:09:14 [12890] rsync: chgrp "/mnt/ftp_client/dietpi-sync/test1" failed: Operation not permitted (1)
2018/02/27 21:09:14 [12890] .d..t..g... ./
2018/02/27 21:09:14 [12890] .d..tp.g... test1/
2018/02/27 21:09:14 [12890] >f+++++++++ test1/yoga-fallinmode.jpg
2018/02/27 21:09:14 [12890] rsync: mkstemp "/mnt/ftp_client/dietpi-sync/test1/.yoga-fallinmode.jpg.da7Bxh" failed: Operation not supported (95)
2018/02/27 21:09:14 [12890] sent 208,897 bytes  received 336 bytes  139,488.67 bytes/sec
2018/02/27 21:09:14 [12890] total size is 208,676  speedup is 1.00
2018/02/27 21:09:14 [12890] rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2
the accessn permission of ftp-client:

Code: Select all

drwxr-xr-x  1 dietpi root         1024 Jan  1  1970 ftp_client
Thanks you for your help!!!
Last edited by charlyb9978 on Mon Mar 12, 2018 10:19 pm, edited 1 time in total.
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: problem with dietpi-sync and FTP (or with me...)

Post by k-plan »

Hi,

as far as I mention your problem, you have to take care how FTP Server and FTP Clients works.

Please start to read here:

Accessing files on your DietPi system

and

ProFTP - FTP Server Details

Very important is
What is the default destination directory for File Servers?:
- /mnt/dietpi_userdata
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
charlyb9978
Posts: 3
Joined: Tue Feb 27, 2018 9:18 pm

Re: problem with dietpi-sync and FTP (or with me...)

Post by charlyb9978 »

Hello k-plan,

Thanks for your answer.

I rode the two url and i think i followed the good instructions but i didn't explain with enough details on my first message.

On the RPI n°2, on mnt/dietpi-userdata/ i create a folder called 'test' with inside an other folder called 'test1' with inside a picture (yoga.jpg).
On the RPI n°3 i create a ftp server with dietpi-software
On the RPI n°2 i configure a ftpclient (dietpi-config/Networks option: NAS) with the IP of the RPI n°3, FTP username (root) and password (dietpi)

On the RPI n°2, i use dietpi-sync with this configuration:
- Source : /mnt/dietpi_userdata/test
- Target :/mnt/ftp_client/diet-sync

When i run diet-sync i have a error message (with the log of my first message). The folder 'test1' is created on the RPI n°3 (mnt/dietpi_userdata/dietpi-sync/test1) but not the file (yoga.jpg).

Thanks for your help
charlyb9978
Posts: 3
Joined: Tue Feb 27, 2018 9:18 pm

Re: problem with dietpi-sync and FTP (resolved.)

Post by charlyb9978 »

Hello,

i found solutions to my problems:

for the first part of the log:

Code: Select all

2018/02/27 21:09:13 [12890] rsync: chgrp "/mnt/ftp_client/dietpi-sync/." failed: Operation not permitted (1)
2018/02/27 21:09:14 [12890] rsync: chgrp "/mnt/ftp_client/dietpi-sync/test1" failed: Operation not permitted (1)
i changed directly, on etc/fstab, the group of "ftp_client".
before on fstab:

Code: Select all

#FTP Client Mount--------------------------------------------------
curlftpfs#dietpi:dietpi@192.168.0.21 /mnt/ftp_client fuse auto,allow_other,direct_io,transform_symlinks,uid=1000,user,nonempty,_netdev 0  0
after on fstab:

Code: Select all

#FTP Client Mount--------------------------------------------------
curlftpfs#dietpi:dietpi@192.168.0.21 /mnt/ftp_client fuse auto,allow_other,direct_io,transform_symlinks,uid=1000,gid=1000,umask=002,user,nonempty,_netdev 0  0
After this modification, the access permission dietpi/root become dietpi/dietpi.


for the second part of the log:

Code: Select all

2018/02/27 21:09:14 [12890] rsync: mkstemp "/mnt/ftp_client/dietpi-sync/test1/.yoga-fallinmode.jpg.da7Bxh" failed: Operation not supported (95)

the problem is that curlftpfs does not allow the creation of temp file. But rsync need it to work (compare the size of source and the target).
On rsync, you can use a option --temp to specify a local directory for the creation of this temp files.

so you change Dietpi/dietpi/dietpi-sync

Find the line:

Code: Select all

#Sync
G_RUN_CMD rsync $rync_options --log-file=$LOGFILE  --exclude-from="$FP_EXCLUDE_GLOBAL" --include-from="$FP_INCLUDE_GLOBAL" "$FP_SOURCE"/ "$FP_TARGE$ echo -e "Sync completed: $(date +"%d-%m-%Y_%H%M")" >> "$FP_TARGET/$SYNC_STATS_FILENAME"
and modify:

Code: Select all

#Sync
G_RUN_CMD rsync $rync_options --log-file=$LOGFILE --temp-dir=/var/tmp --exclude-from="$FP_EXCLUDE_GLOBAL" --include-from="$FP_INCLUDE_GLOBAL" "$FP_SOURCE"/ "$FP_TARGE$ echo -e "Sync completed: $(date +"%d-%m-%Y_%H%M")" >> "$FP_TARGET/$SYNC_STATS_FILENAME"
And normaly it's work!

Tchuss
Post Reply