Go to advanced search

by doubleudee1
Fri Aug 09, 2019 12:07 pm
Forum: General discussion
Topic: Swapping HDD for Larger Size in NAS
Replies: 9
Views: 227

Re: Swapping HDD for Larger Size in NAS

I've tried removing the old drive from the external HDD caddie and then inserting the new one, then I powered the caddie up again and did the following:- =========message while trying to mount drive======================================= [email protected]:~ $ sudo blkid /dev/mmcblk0p1: LABEL="RECOVERY"...
by doubleudee1
Fri Aug 09, 2019 10:44 am
Forum: General discussion
Topic: Swapping HDD for Larger Size in NAS
Replies: 9
Views: 227

Re: Swapping HDD for Larger Size in NAS

This is the results from me entering the command 'cat /etc/fstab' [email protected]:~ $ cat /etc/fstab proc /proc proc defaults 0 0 /dev/mmcblk0p6 /boot vfat defaults 0 2 /dev/mmcblk0p7 / ext4 defaults,noatime 0 1 # a swapfile is not a swap partition, no line here # use dphys-swapfile swap[on|off] for ...
by doubleudee1
Fri Aug 09, 2019 6:00 am
Forum: General discussion
Topic: Swapping HDD for Larger Size in NAS
Replies: 9
Views: 227

Re: Swapping HDD for Larger Size in NAS

Thanks for your replies (All) FYI I only have a single caddie for external drive, so just swap HDD's? I'm not bothered about copying the images over to the new drive, so no problems there. The Operating system is on the Pi itself. I am the sole owner, and I log in as pi but obviously have changed th...
by doubleudee1
Thu Aug 08, 2019 3:22 pm
Forum: General discussion
Topic: Swapping HDD for Larger Size in NAS
Replies: 9
Views: 227

Swapping HDD for Larger Size in NAS

I have set up a NAS on my pi but am finding the HDD is a little too small (500GB), is it possible to just swap it for a larger drive (4TB) as setting it up in the first place was for testing purposes only. My pi is connected to an external Drive Device (made by inateck - powered from mains) so I can...
by doubleudee1
Thu Aug 08, 2019 3:13 pm
Forum: General discussion
Topic: Unable to run executable .sh file from crontab?
Replies: 9
Views: 177

Re: Unable to run executable .sh file from crontab?

All working fine now, thanks for your help everyone.
WD
by doubleudee1
Thu Aug 08, 2019 12:07 pm
Forum: General discussion
Topic: Unable to run executable .sh file from crontab?
Replies: 9
Views: 177

Re: Unable to run executable .sh file from crontab?

OK, done all above, #!/bin/bash at top of all files, arr=(/home/pi/CCTV/FrontOfHouse/*.jpg) is now the array and crontab changed as below 15 * * * * /home/pi/CCTV/RearOfHouse/CreatejpgDirs.sh 20 * * * * /home/pi/CCTV/FrontOfHouse/CreatejpgDirs.sh Waiting to see what happens.............................
by doubleudee1
Thu Aug 08, 2019 11:40 am
Forum: General discussion
Topic: Unable to run executable .sh file from crontab?
Replies: 9
Views: 177

Re: Unable to run executable .sh file from crontab?

Thanks all, will give it a shot now.
WD
by doubleudee1
Thu Aug 08, 2019 11:04 am
Forum: General discussion
Topic: Unable to run executable .sh file from crontab?
Replies: 9
Views: 177

Re: Unable to run executable .sh file from crontab?

Apologies, I have 2 CCTV cams, 'FrontOfHouse' and 'RearOfHouse' where the files are sent from, I may have mixed up Front, for Rear above, but there are two identical scripts with minor changes to suit either. A file may come in as '/home/pi/CCTV/RearOfHouse/ARC20190315080521.mp4', so how would the a...
by doubleudee1
Thu Aug 08, 2019 10:55 am
Forum: General discussion
Topic: Unable to run executable .sh file from crontab?
Replies: 9
Views: 177

Unable to run executable .sh file from crontab?

Hi I have writen the code below and would like to automate it so I have aded a line to crontab. ## this file is being ran from the directory on the HDD '/CCTV/RearOfHouse/' (which is connected to the pi) # create an array with all the files/dir inside ~/CCTV/RearOfHouse/ #!/bin/bash arr=(~/CCTV/Rear...
by doubleudee1
Fri Apr 12, 2019 12:04 pm
Forum: Beginners
Topic: How to run an executable file from CRON?
Replies: 5
Views: 200

Re: How to run an executable file from CRON?

Thanks all
Thats cleared it up for me.

WD
by doubleudee1
Fri Apr 12, 2019 10:19 am
Forum: Beginners
Topic: How to run an executable file from CRON?
Replies: 5
Views: 200

How to run an executable file from CRON?

I have a couple of executable files in different directories that I would like to run at a set time, I have already got a cron file which I have a couple of commands I run in the mornings but how do I run an executable at a set time within the same cron file? e.g. my executable is in /dir1/dir2/dir3...
by doubleudee1
Thu Apr 11, 2019 11:03 am
Forum: Other programming languages
Topic: nested 'if' statements in a shell script?
Replies: 6
Views: 668

Re: nested 'if' statements?

http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-6.html else: is not else So I have to have one 'if' ....... 'fi' statement for every change I want to make? I only used the elif as I thought I could nest all changes in one 'if' ...... 'fi' statement, or is there an alternataive statement I should be usi...
by doubleudee1
Thu Apr 11, 2019 10:48 am
Forum: Other programming languages
Topic: nested 'if' statements in a shell script?
Replies: 6
Views: 668

nested 'if' statements in a shell script?

I want to move some files from one directory to another, I have the names of the diectories in variables, but initally I am testing it with the code below but am getting the errors show. How is nesting achived so i can run a statement such as below (the loop to change files & directories is not show...
by doubleudee1
Thu Apr 04, 2019 1:44 pm
Forum: Other programming languages
Topic: Another exe - mkdir question?
Replies: 6
Views: 574

Re: Another exe - mkdir question?

Thanks, but what I am looking to achieve is to create new directories inside the existing "/CCTV/RearOfHouse/" which would be named "201902", … When you say "/CCTV/RearOfHouse/", that means "CCTV off the root directory", not "CCTV relative to /home/pi". Start by creating a variable that is the abso...
by doubleudee1
Thu Apr 04, 2019 10:55 am
Forum: Other programming languages
Topic: Another exe - mkdir question?
Replies: 6
Views: 574

Re: Another exe - mkdir question?

mkdir -p is your friend: -p, --parents no error if existing, make parent directories as needed Thanks, I have '-p' in my code, so does this mean I have to move my executable file into the 'CCTV/RearOfHouse/' directory to run it? as it creates the directory (and sub dirs) inside my 'ExecFiles' dir b...
by doubleudee1
Wed Apr 03, 2019 3:47 pm
Forum: Other programming languages
Topic: Another exe - mkdir question?
Replies: 6
Views: 574

Re: Another exe - mkdir question?

mkdir -p is your friend: -p, --parents no error if existing, make parent directories as needed Thanks, I have '-p' in my code, so does this mean I have to move my executable file into the 'CCTV/RearOfHouse/' directory to run it? as it creates the directory (and sub dirs) inside my 'ExecFiles' dir b...
by doubleudee1
Wed Apr 03, 2019 1:35 pm
Forum: Other programming languages
Topic: Another exe - mkdir question?
Replies: 6
Views: 574

Another exe - mkdir question?

I have a directory where I am keeping all my executable files it is is /home/pi/ExecFiles, I am the only user of my pi so I thought it would be OK to create and run any exec files I want from there. I have created one as shown below:- ###/home/pi/CCTV/RearOfHouse/ARC2019042134139.jpg = full path inc...
by doubleudee1
Thu Mar 21, 2019 5:13 pm
Forum: Other programming languages
Topic: Reading Filenames into an array
Replies: 14
Views: 772

Re: Reading Filenames into an array

I see the same! [email protected]:~ $ FRED=/home/pi *.jpg -bash: *.jpg: command not found [email protected]:~ $ What do you hope to achieve by the "*.jpg" part of that command - it looks superfluous, as proven by the possibility correct output that follows? Sorry, I added the .jpg thinking it wou...
by doubleudee1
Thu Mar 21, 2019 3:51 pm
Forum: Other programming languages
Topic: Reading Filenames into an array
Replies: 14
Views: 772

Re: Reading Filenames into an array

No space! ./filename The script may need to be made executable first: chmod +x filename Thanks, space taken out and file made executable, output now as expected: (except it doesn't like me declaring the type of file to look for)- ./CreateSecurityDirs: line 4: *.jpg: command not found /*.jpg /*.mp4 ...
by doubleudee1
Thu Mar 21, 2019 3:29 pm
Forum: Other programming languages
Topic: Reading Filenames into an array
Replies: 14
Views: 772

Re: Reading Filenames into an array

B.Goode wrote:
Thu Mar 21, 2019 3:10 pm
The only error I get when running the code is:-

-bash: ./: Is a directory
What do you type at the shell (command line) prompt to run your shell script?
I put in :-

./ filename

from the same directory the file I created (above) exists in and then press enter
by doubleudee1
Thu Mar 21, 2019 2:59 pm
Forum: Other programming languages
Topic: Reading Filenames into an array
Replies: 14
Views: 772

Re: Reading Filenames into an array

sorry, same result using your suggested code I didn't suggest any code... If you have an error, share the code and the full text of any resulting error message. ###########################=============================################## ###########################CODE1 #!/bin/bash SOURCE_DIR=/home/p...
by doubleudee1
Thu Mar 21, 2019 2:30 pm
Forum: Other programming languages
Topic: Reading Filenames into an array
Replies: 14
Views: 772

Re: Reading Filenames into an array

As an overall approach, as with conventional programming languages, lots of intermediate snapshots of the state of your variables might help? I think that in the bash shell the echo command might be the tool to use. But, unverified, here is something to check out - You have SOURCE_DIR=/home/pi/CCTV...
by doubleudee1
Thu Mar 21, 2019 12:44 pm
Forum: Other programming languages
Topic: Reading Filenames into an array
Replies: 14
Views: 772

Re: Reading Filenames into an array

topguy wrote:
Thu Mar 21, 2019 12:33 pm
And the error doesnt report any specific line number ?

Do the error go away if you remove:

Code: Select all

"$SOURCE_DIR"/**/*
No, I've tried commening out that line and I still get the same error?
by doubleudee1
Thu Mar 21, 2019 12:23 pm
Forum: Other programming languages
Topic: Reading Filenames into an array
Replies: 14
Views: 772

Reading Filenames into an array

I have this script from a site that i thought would work, that I altered to suit, but I am getting an error '-bash: ./: Is a directory' #!/bin/bash SOURCE_DIR=/home/pi/CCTV/RearOfHouse/TestDirs/ files=( "$SOURCE_DIR"/*.jpg "$SOURCE_DIR"/*.mp4 "$SOURCE_DIR"/**/* ) printf '%s\n' "${files[@]}" # i.e. p...
by doubleudee1
Sun Mar 17, 2019 3:21 pm
Forum: Beginners
Topic: ARC20190311150800.mp4
Replies: 8
Views: 609

Re: ARC20190311150800.mp4

Thanks for your help and guidance.
WD

Go to advanced search