TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ALL
from: DENNIS LEE BIEBER
date: 2018-05-18 17:27:00
subject: Re: ftp causing invalid s

On Fri, 18 May 2018 20:39:42 +0100, RobH  declaimed the
following:

>On 18/05/18 19:32, Dennis Lee Bieber wrote:
>> On Fri, 18 May 2018 16:53:18 +0100, RobH  declaimed the
>> following:
>>
>>>>
>>> I am getting permission denied when I try to save the python script to
>>> /mnt/CCTV/PiZero.
>>> How can I use sudo to do that.
>>>
>>
>>  Why are you trying to put the /script/ there?
>
>Because another poster told me to do that:
>This is what I was told:
>
> > in your script ON THE PI, save to *local directory* /mnt/CCTV/PiZero
> > and the file will show up on the *remote directory* on the nas.
>

 That did not say to save the /script/ in that directory, which is what
you stated you were trying to do -- it said to edit the script so that
/mnt/CCTV/PiZero is where the script is going to save files it creates.

>That is what I have right now: //mnt/CCTV/PiZero,  in the python script

 And that is NOT what you were told to put there. You still have that
double / at the start, which is telling the OS to look for a remote
computer named "mnt" and look for a directory named "CCTV" on it.


>> pi@raspberrypi:~$ mkdir Public/myFakeNAS
>> pi@raspberrypi:~$ mkdir Public/myFakeNAS/aSubDir
>>
>When I do that mkdir Public/myFakeNAS
>it returns
>mkdir: cannot create directory 'Public/myFakeNAS': no such file or directory
>>
>

 That was an example on MY RPI3, from in my default "pi" login. I
already had a Public directory there, and this Public directory is empty.
As I showed in the lines prior to that. (copied below)

> pi@raspberrypi:~$ ls
> Desktop    Downloads  oldconffiles  Public        Templates
> Documents  Music      Pictures      python_games  Videos
> pi@raspberrypi:~$ ls Public
>

 This is why you've been asked to cut&paste the actual lines from the
console window, not hand-type what you think is a copy. Using the actual
console window lines shown above one can deduce:

pi@raspberypi  one is logged into the account "pi" on machine
"raspberrypi"

:~     one is in the account home directory

 "mkdir" default behavior is to only create the last name in the path,
and expects to find all prior path components alread exist (and are
directories).

 As for the script itself...

 Since I believe you are working from the script prototype I provided,
that means changing:

    NASname = os.path.join("/path/to/NAS/mount/point", fname)

to

    NASname = os.path.join("/mnt/CCTV/PiZero", fname)

 Do NOT add any extra / characters, do not try to reference any remote
machine -- when the script is running, it expects to find that path exists
in the local file system. In fact, in the absence of a working "mount",
running the script should result in files being saved in /mnt/CCTV/PiZero
ON THE RPI -- that would verify the functionality of the script. If the
script is saving to /mnt/CCTV/PiZero the only remaining action is to use
the command line "mount" command to map the NAS to /mnt/CCTV/PiZero, where
it replaces the local directory.

 That should be the only change the script needs (unless you want to
remove the short-term use of RAM for buffering the capture, and capture
directly to the NAS... In that case you'd remove the RAMname = os... line,
remove the copyfile() and unlink() lines, and change the start_recording()
to use NASname; I suggest keeping the RAM buffer so that network hiccups
don't interfere with the capture itself).


--
 Wulfraed                 Dennis Lee Bieber         AF6VN
 wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.