Go to advanced search

by Bosse_B
Fri Nov 05, 2021 11:00 pm
Forum: General discussion
Topic: How to assign a variable the output of a complex command?
Replies: 9
Views: 392

Re: How to assign a variable the output of a complex command?

I also tested this but it resulted in the same low resolution (428x240) video: timeout --signal=2 3m youtube-dl -f 'bestvideo[height<=400]+bestaudio/best[height<=400]' -o testing400.mp4 https://msnbcdailyshows.com Note that the timeout function leaves a testing400.mp4.part file but just moving to an...
by Bosse_B
Fri Nov 05, 2021 8:55 pm
Forum: General discussion
Topic: How to assign a variable the output of a complex command?
Replies: 9
Views: 392

Re: How to assign a variable the output of a complex command?

It is that I cannot use "best" as the quality setting because it results in gigantic file sizes, since it is 1280x720 format... So I use a specific quality label which I extracted once and hard coded. Maybe I should have been clearer: the youtube-dl invocation I gave you downloads the bes...
by Bosse_B
Fri Nov 05, 2021 1:09 pm
Forum: General discussion
Topic: How to assign a variable the output of a complex command?
Replies: 9
Views: 392

Re: How to assign a variable the output of a complex command?

So I am back again... First, what am I doing? I have a video download script that gets called in an at job at specific times to extract a 1 hour video section from a continuously running stream. It used to work with ffmpeg when the streamer used m3u8 streams, which could be handled by ffmpeg. But a ...
by Bosse_B
Thu Nov 04, 2021 11:03 pm
Forum: General discussion
Topic: How to assign a variable the output of a complex command?
Replies: 9
Views: 392

Re: How to assign a variable the output of a complex command?

QUALITY=$("$CMD") Here is my script with obfuscated URL with your suggestion included: #!/bin/bash # CMD="youtube-dl -F https://xxxxxxxxx.com/ 2>/dev/null | grep 640x360 | head -n1 | cut -d \" \" -f1" echo "Command: $CMD" QUALITY=$("$CMD") #This doe...
by Bosse_B
Thu Nov 04, 2021 9:03 pm
Forum: General discussion
Topic: How to assign a variable the output of a complex command?
Replies: 9
Views: 392

How to assign a variable the output of a complex command?

I am writing a script which will extract a value from a web source. I can run the command and it will print a value to the screen (single word). But I want to assign the output of the execution to a variable in my script for further use there. How can that be dome? I have tried these approaches: CMD...
by Bosse_B
Tue Nov 02, 2021 4:08 pm
Forum: General discussion
Topic: Trying to rpi-clone a RPi2B running OSMC - problems
Replies: 1
Views: 113

Re: Trying to rpi-clone a RPi2B running OSMC - problems

So I gave up on this and used another RPi4 with GParted installed to erase partitions on the target SDcard and then copy the two partitions from the source SDcard to the destination. Both SDcards were connected to the RPi4 using two USB card readers. The whole operation took about 10 min for an 8GB ...
by Bosse_B
Mon Nov 01, 2021 9:19 pm
Forum: General discussion
Topic: Trying to rpi-clone a RPi2B running OSMC - problems
Replies: 1
Views: 113

Trying to rpi-clone a RPi2B running OSMC - problems

I have an RPi2B running OSMC media center, which I want to move to a RPi3 instead. In the process I decided to clone the SD-card of the RRPi2 to a same size SDcard using the rpi-clone program , which I have used in the past successfully. I have shut down the mediacentre (Kodi) service on the RPi2 an...
by Bosse_B
Sun Oct 17, 2021 9:22 am
Forum: Networking and servers
Topic: How to make network usb0 not start on boot?
Replies: 2
Views: 217

Re: How to make network usb0 not start on boot?

I already had this in the file: interface usb0 metric 100 I think it was put there in order to test the usb0 interface while still having eth0 active... I commented it out and re-enabled usb0, but it did not work - the usb0 is still being used and the AT&T system seems to block ping. I use ping ...
by Bosse_B
Sun Oct 17, 2021 7:33 am
Forum: Networking and servers
Topic: How to make network usb0 not start on boot?
Replies: 2
Views: 217

How to make network usb0 not start on boot?

I have a mobile broadband modem attached by USB to the RPi3. It hooks up to AT&T worldwide. It is visible as network adapter usb0. Right now usb0 connects to the Internet when the RPi3 starts and I don't want this to happen. The reason is that the networking is messed up when the usb0 connects w...
by Bosse_B
Thu Oct 14, 2021 10:41 pm
Forum: General discussion
Topic: how to best erase data on a big usb drive?
Replies: 9
Views: 420

Re: how to best erase data on a big usb drive?

So after I cleaned the drive I could run rsync to replicate the content of /home to the new drive. Then I could switch the mount of the drive from /media/home after first renaming /home to /home_backup. I did this in a script executed as su: #!/bin/bash # This script runs once only to switch home fr...
by Bosse_B
Thu Oct 14, 2021 6:00 pm
Forum: General discussion
Topic: how to best erase data on a big usb drive?
Replies: 9
Views: 420

Re: how to best erase data on a big usb drive?

Would rm -r be a slow function given the size of the data on the disk? rm will just parse the directory structure, unlinking all the allocated sectors and removing the filename entries. It doesn't overwrite the data, just marks it as free space. It shouldn't take long at all. Thanks, this is exactl...
by Bosse_B
Thu Oct 14, 2021 4:28 pm
Forum: General discussion
Topic: how to best erase data on a big usb drive?
Replies: 9
Views: 420

Re: how to best erase data on a big usb drive?

Unmount the filesystem and just create a new ext4fs on there. You can do that from the command line use parted or gparted from the GUI (launched via a terminal). rm -r would also work. It won't fully wipe the data, but will delete the filenames and make all the space available again. Would rm -r be...
by Bosse_B
Thu Oct 14, 2021 4:08 pm
Forum: General discussion
Topic: how to best erase data on a big usb drive?
Replies: 9
Views: 420

how to best erase data on a big usb drive?

I have made a mistake on handling my 500GB disk drive on one 240 GB partition! :( (it has been partitioned into 2 partitions of approximately half capacity, both with ext4)... It was filled up with the wrong data during an overnight rsync copy and now I want to just reset it to empty state. I have l...
by Bosse_B
Wed Oct 06, 2021 6:27 pm
Forum: General discussion
Topic: Using RPi4 as VPN router for a smart-TV?
Replies: 1
Views: 151

Using RPi4 as VPN router for a smart-TV?

Is it possible to use an RPi3/4 as a VPN router for a WiFi connected Smart-TV? Like this: +----------+ +--------+ +-----------------+ +----------+ | Internet |<->| Router |<-->| <VPN> RPi3/4 | Y <---WiFi----> | Smart-TV | +----------+ +--------+ | (router to WiFi)|----+ | | | +-----------------+ +--...
by Bosse_B
Wed Oct 06, 2021 8:53 am
Forum: Raspberry Pi OS
Topic: Where can I configure the at command handler?
Replies: 7
Views: 468

Re: Where can I configure the at command handler?

You have a number of options: * Stop your script from outputting 'Done' unless stdout is a tty Now done that, hopefully it will stop the mail trigger. * Stop bash checking for new mail Don't know how to do that... * Alias at as above. Could be a good idea unless it will only work for manually creat...
by Bosse_B
Wed Oct 06, 2021 6:44 am
Forum: Raspberry Pi OS
Topic: Where can I configure the at command handler?
Replies: 7
Views: 468

Re: Where can I configure the at command handler?

The /var/mail/pi file (yes it seems to be a single text file) contains a number of these text sections: From pi@rpi3-agissr Tue Oct 05 14:35:16 2021 Return-path: <pi@rpi3-agissr> Envelope-to: pi@rpi3-agissr Delivery-date: Tue, 05 Oct 2021 14:35:16 -0500 Received: from pi by rpi3-agissr with local (E...
by Bosse_B
Tue Oct 05, 2021 9:14 pm
Forum: Raspberry Pi OS
Topic: Where can I configure the at command handler?
Replies: 7
Views: 468

Where can I configure the at command handler?

I have installed the at command via apt in order to use it as a way to run jobs at a specific time while inheriting all of the environment and current dir when the at job is created. This has been a no-brainer on Ubuntu but now when I did it on the RPi3 I noticed a strange message when viewing the l...
by Bosse_B
Mon Oct 04, 2021 4:29 pm
Forum: General discussion
Topic: Unattended system upgrade for RPi4 regularly?
Replies: 9
Views: 451

Re: Unattended system upgrade for RPi4 regularly?

So now I also created the /etc/apt/apt.conf.d/02periodic file and populated it according to the defaults shown on the webpage.
It should do the actions once per day now.

But do I have to restart the service for these edits to take effect?
by Bosse_B
Mon Oct 04, 2021 2:09 pm
Forum: General discussion
Topic: Unattended system upgrade for RPi4 regularly?
Replies: 9
Views: 451

Re: Unattended system upgrade for RPi4 regularly?

OK, so I ran the install as described sudo apt install unattended-upgrades apt-listchanges and this created the configuration file /etc/apt/apt.conf.d/50unattended-upgrades Its content with commented out lines removed: Unattended-Upgrade::Origins-Pattern { "origin=Debian,codename=${distro_coden...
by Bosse_B
Mon Oct 04, 2021 12:23 pm
Forum: General discussion
Topic: Unattended system upgrade for RPi4 regularly?
Replies: 9
Views: 451

Re: Unattended system upgrade for RPi4 regularly?

If you insist on running automatic updates you'd install https://wiki.debian.org/UnattendedUpgrades and let that handle it. I had a quick look at that Debian page and found mention of Gnome desktop, which made me pause... upgrades are enabled with the GNOME desktop The systems we are deploying are ...
by Bosse_B
Mon Oct 04, 2021 11:43 am
Forum: General discussion
Topic: Unattended system upgrade for RPi4 regularly?
Replies: 9
Views: 451

Unattended system upgrade for RPi4 regularly?

We are putting RPi devices out on remote locations for monitoring purposes and now the issue of system upgrades have popped up... Is there a way to set up the RPi so it will do an apt update / apt full-upgrade cycle at regular intervals? The locations are hard to get to and we have no way to access ...
by Bosse_B
Sun Oct 03, 2021 12:59 pm
Forum: General discussion
Topic: Rpi4 crashed but I don't know why...
Replies: 14
Views: 538

Re: Rpi4 crashed but I don't know why...

OK, thanks for the suggestions! I will explore the watchdog way further, but I will probably also change the daily messaging to use the same script as is automatically run on system startup, but triggered by cron instead of the cron reboot command. UPDATE So now I installed the watchdog service on ...
by Bosse_B
Sat Oct 02, 2021 5:46 pm
Forum: General discussion
Topic: Rpi4 crashed but I don't know why...
Replies: 14
Views: 538

Re: Rpi4 crashed but I don't know why...

OK, thanks for the suggestions! I will explore the watchdog way further, but I will probably also change the daily messaging to use the same script as is automatically run on system startup, but triggered by cron instead of the cron reboot command. This way I will not disrupt a running system by con...
by Bosse_B
Sat Oct 02, 2021 3:44 pm
Forum: General discussion
Topic: Rpi4 crashed but I don't know why...
Replies: 14
Views: 538

Re: Rpi4 crashed but I don't know why...

Personally I would not be rebooting the system from a cron job every day. If nothing has gone wrong then a reboot is unnecessary. If something has gone wrong it could be down for up to 24 hours before being rebooted. I added this to all of my RPi boxes just to make sure I get an I'm alive message o...
by Bosse_B
Sat Oct 02, 2021 3:38 pm
Forum: General discussion
Topic: Rpi4 crashed but I don't know why...
Replies: 14
Views: 538

Re: Rpi4 crashed but I don't know why...

There is the problem. How do you expect the watchdog to know if any particular user space program has failed? I don't! What I am talking about is a system that has locked up or crashed, not any user program. ... Typically that program will be run from systemd. Things can be configured such that sys...

Go to advanced search