[SOLVED] 'motion' web camera software sort of stopped working till I moved 17,000 files?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
But that is for the file name only, not the target_dir, and they will all go into target_dir location regardless of how you define the generated file name.
And if there is lots of motion, you will get lots of files.
My idea is I could log into the boatPC using remote desktop and look at the AVI and jpg files remotely from home.
I am 20 minutes from marina by car.
Code:
############################################################
# Live Stream Server
############################################################
# The mini-http server listens to this port for requests (default: 0 = disabled)
stream_port 8081
But that is for the file name only, not the target_dir, and they will all go into target_dir location regardless of how you define the generated file name.
And if there is lots of motion, you will get lots of files.
It's probably running out of inodes in that directory, so new files can't be created.
For info, if the OP is using ext2/3/4 then there is no per-directory inode limit since the number of inodes available for use is a global number.
In saying that, if OP is using ext2/3, then there is a limit of 32k *hard links* (e.g. subdirectories) per directory. For ext4, with the dir_nlink feature enabled, which is the default, there is no such limit. If dir_nlink isn't enabled in ext4, then the figure is 64k.
If the dir_index feature is enabled in ext4, then there is a practical limit based on the maximum depth of the htree structure but we would be talking several million directory entries before problems could arise. Normally you would run into performance limitations long before running into this limit.
Perhaps the OP could paste here the initial metadata (not the block group info) from sudo dumpe2fs /dev/sdax (replacing sdax with the relevant filesystem's device) so that we can examine the filesystem structure and inode availability.
I am not at the boatPC to post from there, but I setup as ext4 using the linux installer.
I need to reboot ubuntu, will edit this.
I could not even post a fraction of the terminal, and the terminal runs off....
What to do ?
I solved the pid file issue, so it nows runs without sudo.
Since I had been starting using sudo, all my test folders were owned by root in my home and I was trying to write to those folders.
When I started fresh, it worked.
And I solved the date time by mv the folder as a new name and recreate the original folder and it works.
I setup a script to run every hour, just to see it working using cron -e
my script will start moton, but I can't stop motion yet. If I use 'pkill motion', the script terminates at that line.
But not stopping motion seems to be ok so far, has not been interfering with things..
I am not at the boatPC to post from there, but I setup as ext4 using the linux installer.
I need to reboot ubuntu, will edit this.
I could not even post a fraction of the terminal, and the terminal runs off....
What to do ?
Don't worry about it. If you've solved the problem of the program stopping working then there's no pressing need to look at your inode situation.
Anyway, mea culpa, I should have specified to you that it was easiest to use the -h option to only print the superblock info i.e. sudo dumpe2fs -h /dev/sdax
Don't worry about it. If you've solved the problem of the program stopping working then there's no pressing need to look at your inode situation.
Anyway, mea culpa, I should have specified to you that it was easiest to use the -h option to only print the superblock info i.e. sudo dumpe2fs -h /dev/sdax
Yes, think it will be ok at boat which is mint 18 with ext4
here is ubuntu ext4 at home.
Code:
scott@scott-P5QC:~/Desktop$ sudo dumpe2fs -h /dev/sda3
dumpe2fs 1.42.13 (17-May-2015)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: 263e8967-7eef-4dbd-8eb0-0ab1fcd1c41e
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 15291504
Block count: 61042724
Reserved block count: 3052135
Free blocks: 60035130
Free inodes: 15291493
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1009
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8208
Inode blocks per group: 513
RAID stride: 32744
Flex block group size: 16
Filesystem created: Mon Jan 23 16:36:22 2017
Last mount time: Sun Jul 2 03:03:19 2017
Last write time: Tue Jul 4 06:35:20 2017
Mount count: 8
Maximum mount count: -1
Last checked: Mon Jan 23 16:36:26 2017
Check interval: 0 (<none>)
Lifetime writes: 1587 MB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: d10c120f-5005-4d7d-a547-a37a00c7c8fe
Journal backup: inode blocks
Journal features: (none)
Journal size: 128M
Journal length: 32768
Journal sequence: 0x000000ff
Journal start: 0
scott@scott-P5QC:~/Desktop$
Yes, think it will be ok at boat which is mint 18 with ext4
here is ubuntu ext4 at home.
Code:
scott@scott-P5QC:~/Desktop$ sudo dumpe2fs -h /dev/sda3
dumpe2fs 1.42.13 (17-May-2015)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: 263e8967-7eef-4dbd-8eb0-0ab1fcd1c41e
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 15291504
Block count: 61042724
Reserved block count: 3052135
Free blocks: 60035130
Free inodes: 15291493
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1009
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8208
Inode blocks per group: 513
RAID stride: 32744
Flex block group size: 16
Filesystem created: Mon Jan 23 16:36:22 2017
Last mount time: Sun Jul 2 03:03:19 2017
Last write time: Tue Jul 4 06:35:20 2017
Mount count: 8
Maximum mount count: -1
Last checked: Mon Jan 23 16:36:26 2017
Check interval: 0 (<none>)
Lifetime writes: 1587 MB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: d10c120f-5005-4d7d-a547-a37a00c7c8fe
Journal backup: inode blocks
Journal features: (none)
Journal size: 128M
Journal length: 32768
Journal sequence: 0x000000ff
Journal start: 0
scott@scott-P5QC:~/Desktop$
If this is the PC with which you had the motion problem then it isn't connected to lack of inodes on this data drive (to which I assume you're saving the generated images). In fact, bizarrely, you have very few in actual use. I assume you deleted almost everything off the drive but have kept a few very large files (maybe archives)?
If this is the PC with which you had the motion problem then it isn't connected to lack of inodes on this data drive (to which I assume you're saving the generated images). In fact, bizarrely, you have very few in actual use. I assume you deleted almost everything off the drive but have kept a few very large files (maybe archives)?
This drive is the one at home and was not having trouble with motion files.
I am not even sure it is my OS partition. I have 3 drives, I think in this PC.
Yes, just looked at gparted, sdc5 is my user /home partition, not sda3
Code:
scott@scott-P5QC:~/Desktop$ sudo dumpe2fs -h /dev/sdc5
[sudo] password for scott:
dumpe2fs 1.42.13 (17-May-2015)
Filesystem volume name: <none>
Last mounted on: /home
Filesystem UUID: 0db1fb5a-0727-4347-bfa7-a551d8db6632
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 19456000
Block count: 77824000
Reserved block count: 778240
Free blocks: 1012774
Free inodes: 19066349
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1005
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
RAID stride: 32744
Flex block group size: 16
Filesystem created: Sun May 1 06:26:35 2011
Last mount time: Wed Jul 5 11:12:02 2017
Last write time: Wed Jul 5 11:12:02 2017
Mount count: 16
Maximum mount count: 26
Last checked: Thu Jun 22 07:34:42 2017
Check interval: 15552000 (6 months)
Next check after: Tue Dec 19 06:34:42 2017
Lifetime writes: 7315 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
First orphan inode: 14550095
Default directory hash: half_md4
Directory Hash Seed: daef897a-35ba-4c93-808f-f9cc2c284377
Journal backup: inode blocks
Journal features: journal_incompat_revoke
Journal size: 128M
Journal length: 32768
Journal sequence: 0x03f6453f
Journal start: 10735
scott@scott-P5QC:~/Desktop$
Last edited by sdowney717; 07-06-2017 at 06:36 AM.
This drive is the one at home and was not having trouble with motion files.
I am not even sure it is my OS partition. I have 3 drives, I think in this PC.
Yes, just looked at gparted, sdc5 is my user /home partition, not sda3
Not much use, I'm afraid if this isn't the "boat PC". I thought we were examining the relevant drive on the machine on which you had the problem, not a completely different computer!
Out of interest, why did you think it would be of use running diagnostics on a machine where you hadn't experienced the original problem? I don't get it.
Not much use, I'm afraid if this isn't the "boat PC". I thought we were examining the relevant drive on the machine on which you had the problem, not a completely different computer!
Out of interest, why did you think it would be of use running diagnostics on a machine where you hadn't experienced the original problem? I don't get it.
Point being, I did nothing special installing Mint 18 with ext4, so do you think it would have a different file system configuration versus Ubuntu 16.04 Ext4?
Anyhow, the boat is way over there, and I am way over here.
I am thinking of using Chrome remote desktop to remotely control the boatPC.
they may help you --
off the top of my head without watching these vids. I'd do this with your script.
Code:
#!/bin/bash
echo "foo"
#pkill motion
Log_File="/where/ever/you/want/it/LogFile.log"
Images1=/home/scott/testmotion/motion-files
Move_Images_to="/home/scott/testmotion/motion-files"
Test_folder=/home/scott/testmotion/motion-files
#put a counter in it to split up your images dir a little more?
Runcount=1
while [[ true ]]
do
#inside loop to get updated with each pass.
Date="$(date +%F-%H:%M:%S)"
#only increment it in the first line so it matches in
# second line.
mkdir -pv "$Move_Images_to-$((Runcount++))-$Date" >> $Log_File
mv -v "$Images1" "$Move_Images_to-$Runcount-$Date" >> $Log_File
mkdir -pv "$Test_folder" >> $Log_File
#shut down motion how ever it gets shut down
#and remove PID
rm /path/to/PID
sleep 60
or whatever time one wants.
then call to restart after sleep.
you dir are already set up for it.
#restart motion
motion -c /path/to/config/file
done
I got a say whoever wrote this didn't think far enough past his nose to think someone would want to start, stop, and maybe even pause this application and code it to allow it to be done. making this process a lot easier.
note that is not a completely working script, just an Idea ...
this just shows how the log file looks, maybe redundant or over kill in what you are doing but might come in handy.
Code:
userx%slackwhere ⚡ ~ ⚡> mkdir -vp my/test/dir/ > testLog
userx%slackwhere ⚡ ~ ⚡> cat testLog
mkdir: created directory 'my'
mkdir: created directory 'my/test'
mkdir: created directory 'my/test/dir/'
userx%slackwhere ⚡ ~ ⚡> cd my
userx%slackwhere ⚡ my ⚡> ls
test
userx%slackwhere ⚡ my ⚡> cd test
userx%slackwhere ⚡ test ⚡> ls
dir
userx%slackwhere ⚡ test ⚡>
MOD: hours later I see its been marked solved, so .. goody -- now you can be a spy master.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.