EXTREME Overclocking Forums
Home | Reviews | Forums | Downloads | RealTime Pricing Engine | Folding Stats Contact Us


Go Back   EXTREME Overclocking Forums > Software Discussion > Linux, BSD, Alternative OS's

Welcome Guest Visitor! Please Register, It's Free and Fun To Participate!
The EXTREME Overclocking Forums are a place for people to learn how to overclock and tweak their PC's components like the CPU, memory (RAM), or video card in order to gain the maximum performance out of their system. There are lots of discussions about new processors, graphics cards, cooling products, power supplies, cases, and so much more!

You are currently viewing our boards as a "guest" which gives you limited access to view most discussions. You need to register before you can post: click the register link to proceed. Before you register, please read the forum rules. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own pictures, and access many other special features. Registration is fast, simple, and absolutely free! To start viewing messages, select the forum that you want to visit from the selection below.

After you have registered and read the forum rules, you can check out the FAQ for more information on using the forum. We hope you enjoy your stay here!

Note To Spammers: We do not allow unsolicited advertising! Spam is usually reported & deleted within minutes of it being posted, so don't waste your time (or ours)!


Please Register to Post a Reply
 
Thread Tools
Old 11-20-2011, 10:09 AM   #1
Goanna
Good Morning Campers
Goanna's Avatar
Senior Member
 
Posts: 944
Last Seen: 06-20-2017
Age: 33
From: NYC area
iTrader: 33 / 100%
Automating some simple tasks?

I have an acer nettop pc running Linutop OS for digital signage purposes.

http://www.linutop.com/software.en.html

This PC is hooked up to a projector and I turn it on every morning. It projects onto my stores front window.

I like to leave it on for a few hours after I close each night, as there's plenty of bars and restaurants in the town so there's still foot traffic at night.

I usually just login via VNC every night before I leave and run this command in the terminal to shut it down at 11:00pm

Code:
sudo shutdown -h 23:00
I also reduce the system volume to about 50% at night as there are apartments above my shop so I don't want to annoy them.

Is there a way I can automate both of these tasks? I forgot once or twice to do it manually and it ran all through the night. Not only might it annoy the neighbors but I am using a DLP projector so I want to preserve as much life out of the bulb as possible.
United States  Offline
    Register to Reply to This Post
Old 11-20-2011, 10:23 AM   #2
jmknsd
Caffeine Overclocker
jmknsd's Avatar
Senior Member
 
Posts: 469
Last Seen: 07-17-2017
From: Houston, TX
iTrader: 0 / 0%
Sounds like what you are looking for is a chron job.
United States  Offline
    Register to Reply to This Post
Old 11-20-2011, 11:01 AM   #3
Goanna
Good Morning Campers
Goanna's Avatar
Senior Member
 
Posts: 944
Last Seen: 06-20-2017
Age: 33
From: NYC area
iTrader: 33 / 100%
Is there a command that can alter the system volume via a cron job? Could I run the cron job automatically at system start?
United States  Offline
    Register to Reply to This Post
Old 11-20-2011, 07:29 PM   #4
UNIXgod
god of UNIX
UNIXgod's Avatar
Senior Member
 
Posts: 1,384
Last Seen: 01-09-2013
iTrader: 0 / 0%
each linux distro may have a different implimentaion of cron. check your man page for details.

to set up cron you type crontab -e as root( or user though user wont have shutdown rights)

for organization I set up my scripts for cron under /root/bin

You can schedule backups and automate everything from simply setting up a couple bourne scripts and setting up a proper crontab
United States  Offline
    Register to Reply to This Post
Old 11-22-2011, 06:28 AM   #5
-=bluebird=-
7|-|3 07|-|3 9
-=bluebird=-'s Avatar
Senior Member
 
Posts: 1,872
Last Seen: Today
Age: 37
From: Oranienburg
iTrader: 0 / 0%
Quote:
Originally Posted by UNIXgod View Post
each linux distro may have a different implimentaion of cron. check your man page for details.

to set up cron you type crontab -e as root( or user though user wont have shutdown rights)

for organization I set up my scripts for cron under /root/bin

You can schedule backups and automate everything from simply setting up a couple bourne scripts and setting up a proper crontab
yeah, crontab -e is the command you have to look at. but in /etc/crontab you can add stuff as well (usually).

be careful with /root/bin. Script shouldnt stay there. Instead you should use /usr/local/bin or /usr/local/sbin for script (last one for admin only )

bb
Germany  Offline
    Register to Reply to This Post
Old 11-27-2011, 03:39 PM   #6
UNIXgod
god of UNIX
UNIXgod's Avatar
Senior Member
 
Posts: 1,384
Last Seen: 01-09-2013
iTrader: 0 / 0%
Quote:
Originally Posted by -=bluebird=- View Post
yeah, crontab -e is the command you have to look at. but in /etc/crontab you can add stuff as well (usually).

be careful with /root/bin. Script shouldnt stay there. Instead you should use /usr/local/bin or /usr/local/sbin for script (last one for admin only )

bb
/etc/crontab is global. no issues using it if you know why. not sure if linux has hier which gives good explanation on where scripts can go. BSD man page here: http://www.freebsd.org/cgi/man.cgi?query=hier
United States  Offline
    Register to Reply to This Post
Old 12-02-2011, 01:54 PM   #7
Goanna
Good Morning Campers
Goanna's Avatar
Senior Member
 
Posts: 944
Last Seen: 06-20-2017
Age: 33
From: NYC area
iTrader: 33 / 100%
A tech that works for linutop OS got back to me with this info,

Quote:
You can use cron for these tasks.

You need to activate the service with this command:
sudo services-blacklist del cron

Then edit a cron configuration file:
sudo gedit /etc/cron.d/local

You can set these lines in the file:

00 23 * * * root /sbin/halt
00 19 * * * linutop /usr/bin/amixer set Master 50% on
I followed these instructions and created a file with these commands

Code:
30 11***linutop /usr/bin/amixer set Master 85% on
00 19***linutop /usr/bin/amixer set Master 50% on
00 23***root /sbin/halt
I saved the file but nothing happens. None of the tasks are carried out. Is there anything else I need to do after saving the file to make sure the tasks run?

Additional Comment:

Nevermind, I now realize the error after posting it here.

I needed a space between each asterisk in the code above.

Code:
30 11 * * * linutop /usr/bin/amixer set Master 85% on
00 19 * * * linutop /usr/bin/amixer set Master 50% on
00 23 * * * root /sbin/halt
Thanks for all the info!

Last edited by Goanna; 12-02-2011 at 01:55 PM. Reason: Automerged Doublepost
United States  Offline
    Register to Reply to This Post
Sponsored Links:
Please Register to Post a Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 08:38 AM.

Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.
Powered by vBulletin
Copyright ©2000 - 2016, EXTREME Overclocking