Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 21 Nov 2014, 16:28
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
Basic Shell (Console) operation for beginners
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 22 of 24 Posts_count   Goto page: Previous 1, 2, 3, ..., 20, 21, 22, 23, 24 Next
Author Message
technosaurus


Joined: 18 May 2008
Posts: 4376

PostPosted: Sun 23 Oct 2011, 20:31    Post_subject:  

Maybe not by the time they get to this page.
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Mercedes350se

Joined: 16 Apr 2008
Posts: 646

PostPosted: Fri 03 Feb 2012, 22:15    Post_subject: save-dvb question  

I found this script at:

http://turtlespond.net/scripts/scripts/save-dvb

but it states, in part, "Scheduling is via atd ... ".

Searching I found this site:

http://www.simplehelp.net/2009/05/04/how-to-schedule-tasks-on-linux-using-the-at-command/

Unfortunately my full 3.01 HDD install does not seem to have this command.

What can I do?

Edit: I found this tutorial quite interesting because it does, in part, what I hope to achieve eventually.

http://turtlespond.net/bash_scripting_tute/00-index.html

It may be of some use to some one else.
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4376

PostPosted: Sat 04 Feb 2012, 22:16    Post_subject:  

at/atd is similar to cron/crond

see also:
http://www.wensley.org.uk/dvb
http://ffmpeg.org/ffmpeg.html#Video-and-Audio-grabbing
(I don't know a light command line way to change channels though... )

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Semme

Joined: 07 Aug 2011
Posts: 4042
Location: World_Hub

PostPosted: Sat 04 Feb 2012, 22:32    Post_subject:  

*Pass..
Edited_time_total
Back to top
View user's profile Send_private_message 
Mercedes350se

Joined: 16 Apr 2008
Posts: 646

PostPosted: Sun 05 Feb 2012, 01:35    Post_subject:  

technosaurus wrote:
at/atd is similar to cron/crond ...


Thank you. I understand that in this script the command is used for one time "scheduling" of the recording function.

So what I need to be able to do is:

1. monitor the time presumably of the RTC - I do not want to download any programs to connect to a time server i.e. up to me to ensure that the RTC is reasonably correct.

2. when the scheduled start time is reached recording will start, and

3. when the duration/stop time is reached stop recording.
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4376

PostPosted: Sun 05 Feb 2012, 03:47    Post_subject:  

I kinda have a daemon process script in my head but I am not at a linux box to test, maybe someone who is can fix my best guess

Code:
while : do
sleep 1 &
sPID=$!
read TIME < /proc/$sPID/stime
case "$TIME" in
$MYSTARTTIME)record >file.mp2 &
  rPID=$!
  sleep 30
  ;;
$MYENDTIME)kill $rPID
  ;;
esac
sleep 30
done

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Mercedes350se

Joined: 16 Apr 2008
Posts: 646

PostPosted: Mon 06 Feb 2012, 02:03    Post_subject:  

Let me state that I am a bash neophyte so I have been "playing" with the above script but I keep getting the error message:

syntax error near unexpected token `done'

Would somebody analyse the script and advise. Please.
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4376

PostPosted: Mon 06 Feb 2012, 02:53    Post_subject:  

sorry about that, my memory failed me

first I forgot to put the : in parens (Smile

I was in C mode and thinking of stat/lstat and that they would correspond to the /proc/PID ... but they are in /proc/PID/stat in a difficult to interpret way (seconds since epoch)

the equivalent is
stat -c %y /proc/pid

but if you are going to do that, you may as well just use date

-sorry, couldn't do a shell only version (well not quickly or easy to follow)

see date --help for the formats

ex.
date +%D@%R
will give you
month/day/year@military time

which will let you do
STARTTIME="05/05/12@22:30"


CURRENTTIME=`date +%D@%R`

if [ "$STARTTIME" == "$CURRENTTIME" ]; then
#your record code here &
rPID=$!
fi

if [ "$STOPTIME" == "$CURRENTTIME" ]; then
kill $rPID
fi

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Mercedes350se

Joined: 16 Apr 2008
Posts: 646

PostPosted: Tue 07 Feb 2012, 01:22    Post_subject:  

It appears that there is no provision for CURRENTTIME to be "polled" until such time that it equals STARTTIME or am I missing something?
Back to top
View user's profile Send_private_message 
Shep

Joined: 08 Nov 2008
Posts: 851
Location: GIRT-BY-SEA

PostPosted: Mon 20 Feb 2012, 09:51    Post_subject:  

Mercedes350se wrote:
Let me state that I am a bash neophyte so I have been "playing" with the above script but I keep getting the error message:

syntax error near unexpected token `done'

Would somebody analyse the script and advise. Please.

I fixed the while loop. But can't comment on the rest. Smile

Code:
while true
do
sleep 1 &
sPID=$!
read TIME < /proc/$sPID/stime
case "$TIME" in
$MYSTARTTIME)record >file.mp2 &
  rPID=$!
  sleep 30
  ;;
$MYENDTIME)kill $rPID
  ;;
esac
sleep 30
done
Back to top
View user's profile Send_private_message 
Shep

Joined: 08 Nov 2008
Posts: 851
Location: GIRT-BY-SEA

PostPosted: Mon 20 Feb 2012, 11:21    Post_subject: Re: save-dvb question  

Mercedes350se wrote:
I found this script at:

http://turtlespond.net/scripts/scripts/save-dvb

but it states, in part, "Scheduling is via atd ... ".

Searching I found this site:

http://www.simplehelp.net/2009/05/04/how-to-schedule-tasks-on-linux-using-the-at-command/

Unfortunately my full 3.01 HDD install does not seem to have this command.

What can I do?


Puppy has the pschedule command.

Also see How to set a cron job.
Back to top
View user's profile Send_private_message 
Mercedes350se

Joined: 16 Apr 2008
Posts: 646

PostPosted: Tue 21 Feb 2012, 02:32    Post_subject:  

Shep,

Thank you for your input.

Regarding pschedule command and cron - it looks as though these are to schedule tasks on a regular basis rather than, in my case, simply recording "as needed".
Back to top
View user's profile Send_private_message 
Shep

Joined: 08 Nov 2008
Posts: 851
Location: GIRT-BY-SEA

PostPosted: Tue 28 Feb 2012, 19:33    Post_subject:  

Mercedes350se wrote:
Regarding pschedule command and cron - it looks as though these are to schedule tasks on a regular basis rather than, in my case, simply recording "as needed".

To install the "at" scheduler follow the links. http://www.murga-linux.com/puppy/viewtopic.php?t=76335
Back to top
View user's profile Send_private_message 
Mercedes350se

Joined: 16 Apr 2008
Posts: 646

PostPosted: Tue 28 Feb 2012, 20:21    Post_subject:  

Shep,

Thanks. One more question - where do I extract it to?
Back to top
View user's profile Send_private_message 
Shep

Joined: 08 Nov 2008
Posts: 851
Location: GIRT-BY-SEA

PostPosted: Tue 28 Feb 2012, 22:25    Post_subject:  

Mercedes350se wrote:
where do I extract it to?

It's a single binary file, so wherever you like. Cool

If you type echo $PATH you'll see the directories that are set to be searched for a command, so any of those will do.

IMO /usr/local/bin sounds appropriate
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 22 of 24 Posts_count   Goto page: Previous 1, 2, 3, ..., 20, 21, 22, 23, 24 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0808s ][ Queries: 13 (0.0106s) ][ GZIP on ]