Page 1 of 2
NOAA-reports
Posted: Sat 30 Apr 2016 12:01 am
by richard_newberry
Hi,
Can NOAA-reports be uploaded via ftp by using ftpd on debian because I use a script at the moment and every month I have to change it to the number of the month i.e. 03 04 etc. Does ftp work? because at the moment it doesn't.
Many Thanks.
Re: NOAA-reports
Posted: Sat 30 Apr 2016 8:09 am
by steve
richard_newberry wrote:Does ftp work? because at the moment it doesn't.
If you mean the automatic ftp of NOAA-style reports by Cumulus MX, then yes, it works for me and for many others. Turn on debug logging and ftp logging, and then after the next upload, zip up the MXdiags folder and attach it along with the ftp log. In the meanwhile, you could show what settings you have in "Web/FTP settings" in the internet settings, and the file formats and ftp directory (and the settings between those) in the NOAA report settings.
I'm assuming that as you specifically mention NOAA reports that the ftp of your web pages etc is working OK?
Re: NOAA-reports
Posted: Sat 30 Apr 2016 10:28 am
by richard_newberry
Thanks Steve for the reply.
This might sound odd but i use a cron script everyday to copy the reports from /home/cumulus/reports to /var/www/NOAA-reports at the beginning of a new month i gotta change the month in the cron script. I wont have time to keep changing it when my son arrives. So im only using ftp for NOAA-reports.
Re: NOAA-reports
Posted: Sat 30 Apr 2016 10:43 am
by steve
You can't just use ftp for NOAA reports, it does the ftp at the next ftp update after midnight. It doesn't sound like you're using ftp anyway - you say your script copies the file (which makes sense as it's the same machine). But in any case, you could presumably change your script so that it works out what the correct filename is.
Re: NOAA-reports
Posted: Sat 30 Apr 2016 11:09 am
by richard_newberry
What script can I use to determine which filename to you at the minute I have this.
@daily cp /home/cumulus/CumulusMX/Reports/NOAAMO0416.txt /var/www/NOAA-reports
Re: NOAA-reports
Posted: Sat 30 Apr 2016 12:43 pm
by rogerthn
richard_newberry wrote:What script can I use to determine which filename to you at the minute I have this.
@daily cp /home/cumulus/CumulusMX/Reports/NOAAMO0416.txt /var/www/NOAA-reports
Maybe something like?
Code: Select all
@daily cp /home/cumulus/CumulusMX/Reports/NOAAMO$(date +%m%d).txt /var/www/NOAA-reports
Re: NOAA-reports
Posted: Sat 30 Apr 2016 12:54 pm
by steve
Don't forget that on the first of the month you need to copy the report from the previous month, so the script should always use yesterday's date.
Re: NOAA-reports
Posted: Sat 30 Apr 2016 1:16 pm
by rogerthn
steve wrote:Don't forget that on the first of the month you need to copy the report from the previous month, so the script should always use yesterday's date.
OK, then something like?
@daily cp /home/cumulus/CumulusMX/Reports/NOAAMO$(date --date="1 days ago" +%m%d).txt /var/www/NOAA-reports
Re: NOAA-reports
Posted: Sat 30 Apr 2016 5:23 pm
by richard_newberry
Thanks Rogerthn,
Let you know if it works OK.
Re: NOAA-reports
Posted: Sat 30 Apr 2016 6:38 pm
by rogerthn
richard_newberry wrote:Thanks Rogerthn,
Let you know if it works OK.
Great!
It should even be possible to do
Code: Select all
@daily cp -v /home/cumulus/CumulusMX/Reports/NOAAMO$(date --date="1 days ago" +%m%d).txt /var/www/NOAA-reports > /tmp/NOAA-reports.log 2>&1
To get a log for the last copy.
Re: NOAA-reports
Posted: Sat 30 Apr 2016 8:50 pm
by richard_newberry
Ok thanks. I will do it before 12am.
Re: NOAA-reports
Posted: Mon 02 May 2016 9:52 am
by richard_newberry
The script doesnt execute @daily but works if i manually execute it. Is it a problem with cron?
I changed %d to %y cus its 0416 etc.
Also do you need -v after @daily?
Thanks
Re: NOAA-reports
Posted: Mon 02 May 2016 4:20 pm
by rogerthn
richard_newberry wrote:The script doesnt execute @daily but works if i manually execute it. Is it a problem with cron?
Anything in /tmp/NOAA-reports.log?
richard_newberry wrote:I changed %d to %y cus its 0416 etc.
My knowledge regarding NOAA-reports = 0
0416 as in April 2016?
When does the file get updates?
When does the filename change?
richard_newberry wrote:Also do you need -v after @daily?
-v (or --verbose) explain what is being done
i.e. If you want to see what has happended is should be there after cp.
Re: NOAA-reports
Posted: Mon 02 May 2016 9:40 pm
by richard_newberry
‘/home/cumulus/CumulusMX/Reports/NOAAMO0516.txt’ -> ‘/var/www/NOAA-reports/NOAAMO0516.txt’
Re: NOAA-reports
Posted: Wed 04 May 2016 11:32 pm
by richard_newberry
No nothing is in /tmp/NOAA-reports.log it's like it doesn't execute in cron under user cumulus
but If I do it when I login as cumulus and put the command in without @daily it works but in the /tmp/NOAA-reports.log it's got weird characters in it as shown in the post previous.