Questions and improvements

Questions and improvements

Postby WaReZ » Tue Jan 14, 2014 11:44 pm

Hi,

First of all, sorry for my poor english in advance.
Thanks to the dev team for their work, I'm happy to play with my NAS like I expected when I bought it.

I found some improvements. Check the list bellow :

- When I try to use the backup utility, I can't choose to backup the content of a directory. An example :
Code: Select all
$cmd="sudo /usr/sbin/rsync --stats --force --ignore-errors --modify-window=2 -HltDvr --delete '/share/1000/public' '/share/1000/SAMSUNG_1'

This is the command generated by the backup utility with cronjob through the portal. What I want is saving entirely the public directory on the usb disk plugged at the front of the NAS (I don't know, one day, the disk will be dead). So, to fix it, It need to put a wildcard at the end of the public directory like this :
Code: Select all
$cmd="sudo /usr/sbin/rsync --stats --force --ignore-errors --modify-window=2 -HltDvr --delete '/share/1000/public/*' '/share/1000/SAMSUNG_1'

Maybe a checkbox or something to add can be relevant.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

- The rsync scripts sucess if I check the log on the web interface but in fact it failed :
Code: Select all
sending incremental file list
public/
rsync: recv_generator: mkdir "/share/1000/SAMSUNG_1/public" failed: Read-only file system (30)
*** Skipping any contents from this failed directory ***

Number of files: 7219
Number of files transferred: 0
Total file size: 813501628117 bytes
Total transferred file size: 0 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 254007
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 254569
Total bytes received: 561

sent 254569 bytes  received 561 bytes  170086.67 bytes/sec
total size is 813501628117  speedup is 3188576.91
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1052) [sender=3.0.9]

I've fixed this with the ntfs driver functionality but maybe it's better to send the standard and error output to the log.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

- The different shares belongs to root with 777 rights. This is bad because when I mount shares with NFS on my laptop, the shares belongs to root and I'm obliged to give all rights to others to be able to write on the share. Why the shares doesn't belongs to the user who created it ? I've an user "cleo" which have the share "cleo" but it belongs to root. I checked "/etc/passwd" and cleo exists, I don't understand. I tried to change some options in the "/etc/exports" file too like "uid", "gid", "async" the exports file is crush at each start of the NFS service. Maybe adding checkboxes to be able to enable options is a good idea ?

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

- Why generate PHP scripts with a lot of exec(sudo) ? It's not possible to write bash script instead ? I'm woried about people who access to their NAS at outside of LAN.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

- I can help devteam other than translating language (espectialy translating lol). Is it possible ?

One more thanks for your work.
WaReZ
Donator VIP
Donator VIP
 
Posts: 21
Joined: Wed Jan 08, 2014 6:18 pm

Re: Questions and improvements

Postby Jocko » Wed Jan 15, 2014 12:33 am

Hi Warez,

Thank for suggestions and first answers about them.

So, to fix it, It need to put a wildcard at the end of the public directory
I understand your purpose but maybe you want to use your USB disk also for other thing that to backup the public share and so create a folder public and not only copy its content is a good way ;)
If you use cronjob you can easily add the '/*' (or just add '/') in the command line.
But I go to keep your suggestion when we will update the backup menu.

I've fixed this with the ntfs driver functionality but maybe it's better to send the standard and error output to the log.
There is no error. The first message says that the backup menu succeeded to start the rsync process and as is run in background (a backup can take many hours) it can not control the rsync process. So the first step is successful but if there are issues with rsync process you must see the rync.log (it's its purpose...)

- The different shares belongs to root with 777 rights. This is bad because when I mount shares with NFS on my laptop, the shares belongs to root and I'm obliged to give all rights to others to be able to write on the share. Why the shares doesn't belongs to the user who created it ? I've an user "cleo" which have the share "cleo" but it belongs to root. I checked "/etc/passwd" and cleo exists, I don't understand. I tried to change some options in the "/etc/exports" file too like "uid", "gid", "async" the exports file is crush at each start of the NFS service. Maybe adding checkboxes to be able to enable options is a good idea ?
Sorry, but we won't follow you about this, a NAS is a NAS and not a PC : there is no user linux management but only remote users who have access in accordance with the servers settings (samba, FTP, WEBDAV, ...)
Note: I think you should use the option 'root_squash'
Code: Select all
Why generate PHP scripts with a lot of exec(sudo) ? It's not possible to write bash script instead ? I'm woried about people who access to their NAS at outside of LAN.
the web interface uses the php language but sometimes we need to use some shell command and don't worry if you use secure access.
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Questions and improvements

Postby WaReZ » Wed Jan 15, 2014 12:39 pm

Thanks for your answers ;)

I understand your purpose but maybe you want to use your USB disk also for other thing that to backup the public share and so create a folder public and not only copy its content is a good way ;)
If you use cronjob you can easily add the '/*' (or just add '/') in the command line.
But I go to keep your suggestion when we will update the backup menu.

I don't need to backup the user shares because this is why they exists. they are just a copy of user data backing up by the rsync server. The USB disk contains music/videos and I take it when I leave my house for vacancy for example. The goal of this is to have all my music/videos mirroring by rsync every night like an image disk of "public".

There is no error. The first message says that the backup menu succeeded to start the rsync process and as is run in background (a backup can take many hours) it can not control the rsync process. So the first step is successful but if there are issues with rsync process you must see the rync.log (it's its purpose...)

So, adding an another check to verify if the USB key is writable in the php script is a good idea ;)

Sorry, but we won't follow you about this, a NAS is a NAS and not a PC : there is no user linux management but only remote users who have access in accordance with the servers settings (samba, FTP, WEBDAV, ...)
Note: I think you should use the option 'root_squash'

I wouldn't and I can't use it. "/etc/exports" is crushed every restart. The only way to write on NFS share is to "chmod 777" every folders.
WaReZ
Donator VIP
Donator VIP
 
Posts: 21
Joined: Wed Jan 08, 2014 6:18 pm

Re: Questions and improvements

Postby Jocko » Wed Jan 15, 2014 1:08 pm

I don't need to backup the user shares because this is why they exists. they are just a copy of user data backing up by the rsync server. The USB disk contains music/videos and I take it when I leave my house for vacancy for example. The goal of this is to have all my music/videos mirroring by rsync every night like an image disk of "public".
So you use cron and currently edit the rsync job is very easy and allows you to do what you want.
So, adding an another check to verify if the USB key is writable in the php script is a good idea
:thumbup Indeed this can be done. Currently, the script checks if the remote or USB shares are still available before starting the backup, we can also add a check for vfat or ntfs disk.
I wouldn't and I can't use it. "/etc/exports" is crushed every restart. The only way to write on NFS share is to "chmod 777" every folders.
Yes and sorry we won't change that: we must keep these permissions for the other servers.
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Questions and improvements

Postby Jocko » Wed Jan 15, 2014 6:19 pm

Thank your suggestions I just found a bug with the samba remote share when you use cron. :mrgreen:

So the bug will be fixed in the next version.
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Questions and improvements

Postby WaReZ » Wed Jan 15, 2014 9:55 pm

You welcome :)
WaReZ
Donator VIP
Donator VIP
 
Posts: 21
Joined: Wed Jan 08, 2014 6:18 pm

Re: Questions and improvements

Postby Jocko » Wed Jan 15, 2014 10:52 pm

So I updated the backup menu to fix the found bug and I added a checkbox for copying only the source folder content.

Could you test it (see your pm to get the new files) and before I strongly advice you to read the help page about this option.
You can easily lose all data previously saved on your USB disk :whistle (you are warned !)
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Questions and improvements

Postby WaReZ » Thu Jan 16, 2014 10:15 am

Work like a charm ;)
WaReZ
Donator VIP
Donator VIP
 
Posts: 21
Joined: Wed Jan 08, 2014 6:18 pm


Return to Development

Who is online

Users browsing this forum: No registered users and 7 guests