Page 1 of 1

SFTP share created file size zero

Posted: Thu Sep 16, 2021 11:03 pm
by Norbyte
Hi,

I've used SFTP for camera recordings since Surveillance Center doesn't supports fully my FosCam cameras.
So, it worked without issue (except you know the storage management which must be done manually).

Few weeks ago I've discovered all the recorded events created a zero file. Contained nothing.
Camera restart, checking of the settings lead nowhere, then I've tested the user/password access from the camera side to the SFTP share and it cailed even with updated credentials.

Then I changed from SFTP to FTP and the result was the same. Zero files. Then started to enable functions above the standard settings in FTP Advanced tab, like SSL/TLS - nothing.
Then FXP which as a miracle worked. I'm not really familiar why and how and again why, but not all went back to normal.

And all of these were because of teh latest non-beta ADM.

No questions, just shared experiences.

Oh, and increased failes logon attempts in the log on SFTP service, which I disabled now as not in used anymore.

Re: SFTP share created file size zero

Posted: Fri Sep 17, 2021 3:11 am
by Nazar78
Thanks for sharing. I'm not using the Surveillance Center either even it has support for my cams because I need few customizations with less resources. For me I wrote a simple ffmpeg script to RTSP capture, monitor (in case the cams goes down) and housekeep for a month. Used to run it on the NAS but I've moved it to my router since it's using very little CPU (2-5% each cam H.265 1520p) and because I don't want to keep the hdds awaked.

For storage management you could do something like this, snippet taken from a part of my script. You can convert it into a script then schedule in the cron to run every midnight.

Code: Select all

CCTV=/foo/bar # Path to the media. Mine was auto created every 15 mins with /some-paths/Surveillance/cctv-ip/yyyy/mm/dd/cctv-yyyymmdd-hhmmss.mp4
ARCHIVE=31 # Number of days to keep
NEXT="`date --date="next day" +%Y/%m/%d`" # Path to the next day to exclude archiving. Mine the path is pre-created before the next day ../yyyy/mm/dd

echo -n "Archiving CCTV after $ARCHIVE days..."
find $CCTV/* ! -wholename "*$NEXT" -a \( -mtime +$ARCHIVE -o -empty \) -delete>/dev/null 2>&1
echo "OK!"
The above means find and remove the files and/or folders that's path not named as the next day and last modified over 31 days or is empty. Replace "-delete>/dev/null 2>&1" with "-ls" when you're testing to prevent accidental removal of data.

Re: SFTP share created file size zero

Posted: Sat Sep 18, 2021 2:03 pm
by ndl101
Does sound like a bug. I suggest reporting it to Asustor via the support system.

Re: SFTP share created file size zero

Posted: Tue Sep 21, 2021 7:03 pm
by Norbyte
ndl101 wrote:Does sound like a bug. I suggest reporting it to Asustor via the support system.
Ticket posted (#43155), but I don't know will it has effect or not.