Go to advanced search

by makem
Fri Jun 08, 2018 11:27 pm
Forum: Beginners
Topic: Running crontab forever. [Solved]
Replies: 9
Views: 1004

Re: Running crontab forever. [Solved]

I can confirm crontab repeats after reboot :D : grep CRON /var/log/syslog Jun 9 00:15:01 RPIBplus CRON[12268]: (pi) CMD (/home/pi/.expressvpn.sh) Jun 9 00:16:59 RPIBplus cron[303]: (CRON) INFO (pidfile fd = 3) Jun 9 00:16:59 RPIBplus cron[303]: (CRON) INFO (Running @reboot jobs) Jun 9 00:17:01 RPIBp...
by makem
Fri Jun 08, 2018 11:15 pm
Forum: Beginners
Topic: Running crontab forever. [Solved]
Replies: 9
Views: 1004

Re: Running crontab forever.

DougieLawson wrote:
Fri Jun 08, 2018 10:25 pm
That's normal. It's part of /etc/crontab and /etc/cron.hourly.
Ah, and I saw it, see it repeating because I ran:

Code: Select all

grep CRON /var/log/syslog
Thank you
by makem
Fri Jun 08, 2018 7:34 pm
Forum: Beginners
Topic: Running crontab forever. [Solved]
Replies: 9
Views: 1004

Re: Running crontab forever.

All I have done (as far as I am aware) is to make one crontab which I edited a couple of times using crontab -e. However it seems I have woken a sleeping giant! I am now getting the following every hour in terminal: [email protected]:/ $ Jun 8 20:17:01 RPIBplus CRON[7688]: (root) CMD ( cd / && run-parts -...
by makem
Fri Jun 08, 2018 7:26 pm
Forum: Beginners
Topic: Running crontab forever. [Solved]
Replies: 9
Views: 1004

Re: Running crontab forever.

thagrol wrote:
Fri Jun 08, 2018 7:13 pm
They should. Your crontab persists across reboots.

Rather than trust google, try

Code: Select all

man cron
man crontab
in a terminal.
That was on the research route so I must either have not understood it or missed it.
by makem
Fri Jun 08, 2018 7:01 pm
Forum: Beginners
Topic: Running crontab forever. [Solved]
Replies: 9
Views: 1004

Re: Running crontab forever.

Easy thing to test, just add a crontab entry to touch a file every minute or something, verify its working, then reboot and see if its still working :) Having said that, I'm pretty sure crontab survives a reboot. But just test and see. True, but where are the 'words'? I'm running remote and don't w...
by makem
Fri Jun 08, 2018 6:05 pm
Forum: Beginners
Topic: Running crontab forever. [Solved]
Replies: 9
Views: 1004

Running crontab forever. [Solved]

I have been searching for the answer to what seems a simple question: Does a user crontab, (crontab -e) continue running after the next reboot or a shutdown/restart? Obviously it will not run when the machine is off and I am not concerned about those missed whilst off. I do want to know that it will...
by makem
Fri Jun 08, 2018 2:57 pm
Forum: Beginners
Topic: Script error - can't see the wood for trees!
Replies: 10
Views: 1133

Re: Script error - can't see the wood for trees!

I think this is the best method:

Code: Select all

#!/bin/bash

if ! [ "$(ping -c 1 google.co.uk)" ]; then
    expressvpn connect
    
current_time=$(date "+%Y:%m:%d_%H:%M:%S")
echo "Executed at $current_time" >> /home/pi/my.log 2>&1
fi
crontab:

Code: Select all

*/5 * * * * /home/pi/expressvpn.sh
by makem
Thu Jun 07, 2018 12:30 pm
Forum: Beginners
Topic: Script error - can't see the wood for trees!
Replies: 10
Views: 1133

Re: Script error - can't see the wood for trees!

Thank you Paeryn for your detailed explanation which I find very informative. The line "expressvpn connect", is the trigger which if typed in a terminal causes the expressvpn program to reconnect or produce the reply that it is connected. I may have found a command which solves the problem created i...
by makem
Wed Jun 06, 2018 10:57 pm
Forum: Beginners
Topic: Script error - can't see the wood for trees!
Replies: 10
Views: 1133

Re: Script error - can't see the wood for trees!

Pulling hair!

Now it did nothing! Maybe it's to late now, another day tomorrow.
by makem
Wed Jun 06, 2018 10:51 pm
Forum: Beginners
Topic: Script error - can't see the wood for trees!
Replies: 10
Views: 1133

Re: Script error - can't see the wood for trees!

ericcooper wrote:
Wed Jun 06, 2018 10:40 pm
Your "if" command is trying to run "$T2" (and then negate its exit status). You might want something like

Code: Select all

if [ ! "$T2" ]; then
which uses the "[ ... ]" syntactic sugar for the "test" command. Do "man test" to see what it can do.
Thank you, I tried { } :(

Yes must do "man test"
by makem
Wed Jun 06, 2018 10:22 pm
Forum: Beginners
Topic: Script error - can't see the wood for trees!
Replies: 10
Views: 1133

Script error - can't see the wood for trees!

Simple script to check working vpn: #!/bin/bash T1="expressvpn connect" T2="Already connected! Please disconnect first" current_time=$(date "+%H:%M:%S") echo "$T1" if ! "$T2"; then echo "not connected" >> /home/pi/my.log 2>&1 #insert 'send email here later' echo "Executed at $current_time" >> /home/...
by makem
Wed Jun 06, 2018 2:49 pm
Forum: Beginners
Topic: IF THEN ELSE - in a crontab?
Replies: 2
Views: 349

Re: IF THEN ELSE - in a crontab?

Thank you.
by makem
Wed Jun 06, 2018 2:38 pm
Forum: Beginners
Topic: IF THEN ELSE - in a crontab?
Replies: 2
Views: 349

IF THEN ELSE - in a crontab?

I have a vpn on my Pi3 and have a simple script to send the command, "expressvpn connect" every 5 minutes. This returns, "Already connected! Please disconnect first;" if it is connected. If it is not connected then it would accept the connect command. I would like to make this into a crontab job suc...
by makem
Tue May 15, 2018 11:35 am
Forum: Raspbian
Topic: JohnTheRipper-bleeding-jumbo - using rar2john -> john
Replies: 1
Views: 969

Re: JohnTheRipper-bleeding-jumbo - using rar2john -> john

I just went with apt-get install john instead for a trouble free install
by makem
Mon May 14, 2018 1:01 am
Forum: Raspbian
Topic: JohnTheRipper-bleeding-jumbo - using rar2john -> john
Replies: 1
Views: 969

JohnTheRipper-bleeding-jumbo - using rar2john -> john

I have built this from github to obtain a hash file for a rar passworded archive to use with 'john'. I cannot work out how to use the rar2john which is a symlink to extract the hash from the file. lrwxrwxrwx 1 pi pi 4 May 13 23:25 rar2john -> john Guides just say, ./rar2john ../test.rar > ../rar.has...
by makem
Sat Apr 21, 2018 12:47 am
Forum: Raspbian
Topic: Unable to access Raspberry Pi shares
Replies: 8
Views: 1054

Re: Unable to access Raspberry Pi shares

Well, I can now access the shares. The problem is related to using two RPIs. Host name for each was default raspberrypi. I always use fixed IPs and the first RPI was 192.168.2.27. The second RPI I allowed DHCP to set the IP and 192.168.2.43 was given. All during setting this up I have addressed the ...
by makem
Fri Apr 20, 2018 11:45 pm
Forum: Raspbian
Topic: Unable to access Raspberry Pi shares
Replies: 8
Views: 1054

Re: Unable to access Raspberry Pi shares

The NFS config lines may be a bit cryptic, but you only need one line on the server in /etc/exports per share, and one in the /etc/fstab on the client. Cryptic! you can say that again! I took at look and decided before I get involved I should really sort out what appears to be a network problem. Th...
by makem
Fri Apr 20, 2018 11:38 pm
Forum: Raspbian
Topic: Unable to access Raspberry Pi shares
Replies: 8
Views: 1054

Re: Unable to access Raspberry Pi shares

There is definitely something wrong with the network. When I select Browse Network in File Manager, normally all shares on 4 other machines show up immediately in addition to Windows Network and are selectable. Now, for most of today I have only got Windows Network except for one time when Raspberry...
by makem
Fri Apr 20, 2018 10:17 pm
Forum: Raspbian
Topic: Unable to access Raspberry Pi shares
Replies: 8
Views: 1054

Re: Unable to access Raspberry Pi shares

Failed to open "WORKGROUP" Failed to retrieve share list from server: No route to host. "No route to host" suggests a networking problem rather than a server or client configuration problem. Can you ping the Pi from your unbutu box ? PeterO Yes: [email protected]:~$ ping 192.168.2.43 PING 192.168.2.43 ...
by makem
Fri Apr 20, 2018 5:48 pm
Forum: Raspbian
Topic: Unable to access Raspberry Pi shares
Replies: 8
Views: 1054

Re: Unable to access Raspberry Pi shares

rpdom wrote:
Fri Apr 20, 2018 5:35 pm
For sharing from Pi to other Linux systems I always use NFS instead of Samba. The two can co-exist and NFS gives better speed and control.
Thanks Dom, I will check out NFS having never used it. I rarely need windows to Pi and thought Samba was the way from Linux.
by makem
Fri Apr 20, 2018 5:21 pm
Forum: Raspbian
Topic: Unable to access Raspberry Pi shares
Replies: 8
Views: 1054

Unable to access Raspberry Pi shares

I have a RPI3 B+ set up on a WiFi network with a USB SSD drive, have shared the home directories and a folder named 'data' on /media/USBHDD/data. From windows 10 I can access the folder via Samba but cannot access it from xubuntu. When attempting to access the folder the error given is: Failed to op...
by makem
Mon Apr 02, 2018 11:06 am
Forum: Raspbian
Topic: fstrim and external SSD drive
Replies: 2
Views: 1346

Re: fstrim and external SSD drive

I can but to what effect? Does this not cause TRIM to operate continuously and therefore slow things down? I have looked at: https://wiki.debian.org/SSDOptimization but most of it is beyond me as I don't know what would and would not be beneficial on a pi. Edit: [email protected]:~ $ lsblk -D NAME DISC...
by makem
Sun Apr 01, 2018 11:51 pm
Forum: Raspbian
Topic: fstrim and external SSD drive
Replies: 2
Views: 1346

fstrim and external SSD drive

I have an spare external 256GB SSD mounted on /media/USBHDD of an always on pi. I thought I would enable fstrim as I have done on my laptop xubuntu SSD but i get and error: [email protected]:~ $ sudo fstrim /media/USBHDD fstrim: /media/USBHDD: the discard operation is not supported [email protected]:~ $ I...
by makem
Mon Feb 26, 2018 8:07 pm
Forum: Beginners
Topic: Unable to change file permissions (Solved)
Replies: 9
Views: 3764

Re: Unable to change file permissions (Solved)

Great! You have solved it for me.

Code: Select all

UUID=04FE0DB1FE0D9C5 /media/USB_1      ntfs-3g rw,defaults,nofail      0      0
The filemanager tree is correct now.
by makem
Mon Feb 26, 2018 6:53 pm
Forum: Beginners
Topic: Unable to change file permissions (Solved)
Replies: 9
Views: 3764

Re: Unable to change file permissions

It's best to use PARTUUID notation when mounting a USB drive in fstab as the /dev/sdX assignment can change: PARTUUID=????????-?? /mnt/usb ntfs-3g rw,defaults,nofail 0 0 NTFS does not support changing Linux user:group and permissions using chown and chmod. Thank you for that help. I have always use...

Go to advanced search