Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[ Wing FTP Server ][ 6.3.3.0 ] ftp(s)/http(s) Server
#51
Will be done this weekend
------------------------------------------------------------------------
[Image: linkedinbutton.jpg][Image: btn_donate_LG.gif]
Please respect my work and dont share my modules
Reply
#52
Hi Mate, just waiting to get access

but Im wondering how do you replace the old version
each time. currently I have 4.3.6 and its not free
after 30 days.. and the sales dept wont give me a
reg key to get around it.
wonder if I can upgrade that to 6 and not have
to re-do all the settings again.

thecus admin panel I only see stop/start and delete or install
no upgrade module.

UPDATE.. it detected ver 4.x and upgraded it sweet
Reply
#53
I dont think Im approved to post ?

I still cant download the module..
I dont care if its not 6.4 as I need to get my ipcams upload to thecus again
and I use LUA to auto purge script nicer then the rubbish built in
wing ftp is nice but support suck they want big money
and 6.x is only free version

hope you are ok from C-19 too.

UPDATE can download now. thanks
Reply
#54
Dam, they lied.. the LUA engine is disbled for free
and I need it to run the script to clean up
files from ipcamera

what a nasty thing to do. say its free for noncommerical
when its not fully functional.
they do this so you pay 200 usd in the end.

wondering if theres a LUA engine module for thecus
thats separate..

Correction: LUA engine is only in the corp version they want $899usd thats like 8 months
savings for me.. for a home user. I think that business sucks for doing that
I see http://www.lua.org say its open source
no module exists for it.

I guess might be another way around it..
converting my LUA script.. to some LINUX script that
runs on thecus.. but Im not up to speed on console and
doing that.

here is my LUA wing script.. purges old files over 7 days
deletes empty folders
makes a daily folder and moves any upload ipcam images
to that folder every 1 hour when I set 1 hour on scheduler
I normally kick initial run off 3 minute before the hour
yes it could be optimized as I added bits on it as went..
]]]]]]]]]]]

local root_dir = "/raid/FTP_HOME/"
local root_dir_imgs = "/raid/FTP_HOME/IpCameraImages/"
--physical path for storing temporary uploaded files
local timeout = 3600*24*7 --delete uploaded files older than 7 Days
local removefiles = {} --creates an empty table
local now = os.time()
local movefiles = {} --creates an empty table
local day=os.date("%d-%m-%Y")
local foldername=root_dir_imgs .. day



function checkfile(nowdir)
if c_GetFileDir(nowdir) ~= nil then
for isdir,filename in c_GetFileDir(nowdir) do
if isdir == false then
if filename ~= nil and filename ~= "." and filename ~= ".." then
local filepath = nowdir.."/"..filename
if c_FileExist(filepath) then
if c_GetFileTime(filepath) + timeout < now then
table.insert(removefiles, nowdir.."/"..filename)
end
end
end
else
checkfile(nowdir.."/"..filename)
end
end
end
end


--Walks a file tree and delete empty folders except the root folder
function EmptyFolderDeleter( root )

local walk = function( path )

--cycle through the current directory, walking directories
for dir in c_GetDir( path ) do
walk( path..dir.."/" )
end

--if we've got this far then we're at the bottom of the tree
--there are no more directories to visit
--now check if there is ANYTHING (file or folder) in the current folder
local empty = true
for isdir, file in c_GetFileDir( path ) do
empty = false
break
end

--now check the 'empty' flag and if the folder is the root

if empty and path ~= root_dir_imgs then
local fp = assert(io.open(root_dir_imgs.."/output.log", "a+"))
fp:write( path.."\n" )
fp:close()
c_RemoveFileDir( path )
end
end

walk( root )
end

function getallfiles(nowdir)
if c_GetFileDir(nowdir) ~= nil then
for isdir,filename in c_GetFileDir(nowdir) do
if isdir == false then
if filename ~= nil and filename ~= "." and filename ~= ".." then
local filepath = nowdir.."/"..filename
if c_FileExist(filepath) then
if c_GetFileTime(filepath) < now then
table.insert(movefiles, nowdir.."/"..filename)
end
end
end
else
--is a sub-dir so ignore only do root
end
end
end
end

function get_file_name(file)
return file:match("^.+/(.+)$")
end

checkfile(root_dir)

for _,filename in ipairs(removefiles) do
c_RemoveFileDir(filename)
end

local root=root_dir_imgs
for dir in c_GetDir( root ) do
EmptyFolderDeleter( root..dir.."/" )
end

c_MkDir(foldername)

getallfiles(root_dir_imgs)
for _,filename in ipairs(movefiles) do
os.rename(filename, foldername.."/"..get_file_name(filename))
end

[[[[
Reply
#55
i will check to create a LUA module, just need to find a bit of time
------------------------------------------------------------------------
[Image: linkedinbutton.jpg][Image: btn_donate_LG.gif]
Please respect my work and dont share my modules
Reply
#56
thanks mate, I think it will just be LUA engine
that module.. we will need a way to schedule
it every so many minutes. I guess you could
add a simple script creator for it and enter a time
from 10min to 60min

I dont think crushftp has a LUA engine and scheduler
I see wing ftp is chinese made and owned.. I put
a compliant in on their sales page. claiming its free
for non-commerical to NZ gov debt. it should say
its free except the LUA needs a corp license or
what bits are disabled.

I did a search and I see thecus has a guy that made
a Cron script launcher.. but I would have to figure
out how to convert LUA to pure linux script and
Im not up to speed on that. and its going to take
me a while to figure out
http://www.fajo.de/main/en/thecus/modules/fajocron

if anyone had a script that can purge >7 day old
files from the uploaded folder on ftp including
sub folders and can move uploaded files to
a daily folder like day-month-year e,g. 01-01-2020
let me know.. search came up empty

the thing is.. if you upload a ipcam snap every 1 sec
and the camera dont auto make a day folder
its grows big and makes it hard to deal with mass
of files. espc if you remote connect from windows 10
it basically locks it up explorer.

cheers Paul (kiwiman2020)

I just checked crushftp. it has lots more. a folder manager could do
clean up but move files to a fix location not move to a dated
folder.. but I see it has plugins to do advance stuff that
could make a date folder.
license says $70.. its atleast reasonable. free for 30 days
the scheduler again is enterprise only $1000
but wonder if need that if can use the other 2 options
and it dont have LUA engine. only wing ftp does
which makes it simpler soft by doing so.
https://www.crushftp.com/features.html (see enterprise
in quotes for parts thats going to cost)
and plugins
https://www.crushftp.com/features.html

im still think a script to purge and move files on thecus is simpler
while using wing ftp..
but like you need the skills and time to figure it all out

cheers
Reply
#57
Ok Im going to try to learn crontab and see if works
with that module.
looks simple.. going to try to make a dated folder every 10 minutes
and see if works

*/10 * * * * mkdir /path/$(date +\%y\%m\%d)

0Update
hmmm its not working I tried instant to make a folder and its
not doing.. the module lacks show error log.so not sure how
to look for that.

try * * * * * administrator mkdir /raid/FTP_HOME/crontest

looks like if replace user with root it works
Reply
#58
I figured it out using the Cron Module.. A replacement for wingftp missing LUA script engine
for workaround so my above script converted to this
incase anyone else wants to use or mod this or LUA
of course you might use another ftp path location so alter to suit

# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed

# * * * * * = immediate run */10 * * * * = every 10 mins reprt
#test access block comment out
#* * * * * root mkdir /raid/FTP_HOME/$(date +\%y-\%m-\%d)
#* * * * * root mkdir /raid/FTP_HOME/CronTest
#* * * * * root mkdir /raid/FTP_HOME/IpCameraImages/CronTest
#* * * * * root mkdir /raid/FTP_HOME/IpCameraVids/CronTest
#test block end.
#make a date folder to move all root uploads to it
*/5 * * * * root mkdir /raid/FTP_HOME/IpCameraImages/$(date +\%y-\%m-\%d)
#Move all root files to date folder
*/10 * * * * root /usr/bin/find /raid/FTP_HOME/IpCameraImages/ -type f -maxdepth 1 -exec mv {} /raid/FTP_HOME/IpCameraImages/$(date +\%y-\%m-\%d)/ \;
#Delete all files older then 7 days old
*/10 * * * * root /usr/bin/find /raid/FTP_HOME/IpCameraImages/ -name "*.*" -type f -mtime +7 -delete
#Delete all empty folders like old date folders
*/10 * * * * root /usr/bin/find /raid/FTP_HOME/IpCameraImages/ -type d -empty -delete
#Delete all asf video files uploaded by 2nd ipcam older then 7 days
*/10 * * * * root /usr/bin/find /raid/FTP_HOME/IpCameraVids/ -type f -maxdepth 1 -mtime +7 -delete

change the schedule times like first one to */10 so repeats or every hour 0 * * * *
Reply
#59
I might of found a bug with wing ftp module to do with disk quota
I had it set to 140000000 kb.. 14gb and I checked
space and total files were only 300gb and it was saying over quota

so I disabled that feature.

I think it was adding each upload but didnt know
uploads were deleted every 7 days
it didnt rescan to check. and I didnt reboot server.

this is not user upload quota unless im mistaken somehow.
anyhow the cron keeps it in check without needed that feature
Reply
#60
(08-08-2020, 09:44 AM)outkastm Wrote: Will be done this weekend

hmm you have long weekends  ;-)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)