On Thursday, October 4, 2018 at 1:57:48 PM UTC-7, Steve2Q wrote:

> Gary and Vince After sending my previous post, I started reading some more 
> about memory leaks. It appears that cron jobs (if poorly coded) can 
> sometimes be the cause. 
>

Unlikely if they just run and exit.
 

> With that in mind, I am attaching both the cron, and the process it  
> starts so maybe you can pick up something. I am also having a problem with 
> the crontab; if I issue the command crontab -l  I get the following at the 
> end:
>
> The cron:
> # m h  dom mon dow   command
> MAILTO=xx...@gmail.com <javascript:>
> 59 23 * * * /home/bin/./weewxbackup
>
>
ok - you are getting the crontab associated with the account you're using 
when you run the crontab command.   The actual file is likely  
/var/spool/cron/crontabs/your_user_name_here

I want to edit this crontab to stop running the following process, but when 
> I issue crontab -e I get a generic crontab, not the one I wish to edit.
>
>
I've never seen that happen.   I could potentially see you getting 
permission denied if you are running as user 'pi' and trying to see or edit 
the crontab of user 'root', but it would be very surprising if you're 
really seeing what you described.

Try "sudo ls -la /var/spool/cron/crontabs" and I'd expect it would look 
something like:

drwx-wx--T 2 root crontab 4096 Aug 17 11:10 .
drwxr-xr-x 3 root root    4096 Feb 25  2016 ..
-rw------- 1 pi   crontab 1275 Aug 17 11:08 pi
-rw------- 1 root crontab 1090 Aug 17 11:10 root


 

> The process (weewxbackup in /home/bin)
> #!/bin/bash
> #This script zips and backs up to web site
> #Following line added to prevent "TERM invronment variable not set" error
> export TERM=${TERM:-dumb}
> clear
>
> echo "Backing up weewx.sdb"
>
> cd /home/weewx/archive
> sudo cp weewx.sdb weewxpi2.cpy
> sudo gzip weewxpi2.cpy
> sudo lftp -e 'put /home/weewx/archive/weewxpi2.cpy.gz; bye' -u xxxxx,
> xxxxxxxftp.xxxabcd.org
> sudo rm weewxpi2.cpy.gz
>
> echo "Done - weewxpi2.sdb zipped and uploaded to xxxabcd.org"
>
>
>
I don't know what 'clear' in a non-interactive window will do, but it can't 
be good.  It's probably throwing an error, but you're not capturing stderr 
in your crontab invocation so we're in the blind here.   Comment out the 
'clear' line for starters.

Change your 'echo' commands to be 'logger' and the lines will be written to 
your syslog.   Just glancing at it, it is possible that the 'bye' to close 
the connection isn't really closing the lftp session, but it's hard to say 
for sure.  I'd expect the other side should close the connection in a few 
minutes anyway, but lots of ISPs have odd implementations.

 

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to