Tiny Core Linux
Tiny Core Base => CorePlus => Topic started by: Boss 429 on April 28, 2017, 10:32:15 AM
-
Hi,
I've been searching the forums and I'm not really seeing a way to shut down TC at a specific time. I would like to be able to shut the machines down at night without having to interact with them. The closest thing I've found was setting up a delay timer, but that won't quite work for my application.
Thank you
-
hi,
you are looking for a tool like cron.
with cron-jobs you can define timetables for commands f.e. shutdown at a specific time.
keep on hacking :-)
-
You can use the cron bot code to start cron at boot.
The command crontab -e is used to create a cron job. An editor will open where you can write in something like this:
00 00 * * * /usr/bin/filetool.sh -b ; /usr/bin/sudo /sbin/poweroff
This would, at midnight, perform a backup and shutdown the system.
Then add var/spool/cron/crontabs to your backup.
-
Misalf, When I tried to insert the code into crontab, it wouldn't allow me to run a backup, and the next line of text started to jump across the screen every time I hit the return key to go to the next line. I'm not really sure what would be causing that, but it's consistently doing it
-
Do not use leading "/" in .filetool.lst.
-
Works here.
Are you familiar with the vi editor? It can be quite confusing to use. Maybe that's what happened?
-
I'm fairly familiar with vi editor. I'm just not sure if I'm saving it with the wrong extension? maybe the wrong location? I have entered the code as you have it in your previous post. I get a notification on boot that Crond is running as well.
-
I'm just not sure if I'm saving it with the wrong extension? maybe the wrong location?
With crontab -e , an editor opens with a temporary file name which must not be changed nor must the location be specified; cron takes care about that.
-
In lots of Linux dists. You can set the EDITOR environment variable.
So crontab -e
can use that, instead of the default vi.
export EDITOR=nano
-
I'm sorry for the poor quality, my camera wouldn't focus and I'm not sure how to take screenshots in TC.. but every time I run crontab -e, this is what happens when I close the command. I'm not sure why it's doing this. I even tried a fresh install of TC just to make sure that it wasn't something that I might have caused.
-
Hi Boss 429
It appears to be executing a find command upon returning to the command prompt for some reason. Also the carriage
returns are behaving like just linefeeds.
-
I ran the find command to show what it was doing, and when I try to run the backup command, it won't let me. it will more or less "lock up" and not let me do anything unless I reboot
-
Hi Boss 429
I see, so if you were to just hit enter a bunch of times the prompt would keep shifting down 1 line and to the right by
the width of the prompt. I've seen that behavior when a program launched from a terminal crashes or misbehaves. I
close the terminal and open a new one in that case.
-
That's exactly what it's doing. Would I just need to run the "exit" command and log back to in to piCore to do so? I'm not using a GUI interface
-
Hi Boss 429
That's certainly worth giving a try.
-
The issue in the image is normally called the "staircase effect" it can be fixed with
stty onlcr
but it's easier to remember stty sane
I would guess you actual problem is the broken (for the command line) ondemand script in the current version.