Okay, I got a pretty big problem here, I'm not sure what to do exactly.
I kept trying, trying, restarting from scratch and everything until I was actually yelling and cussing and pulling my hair out. I'm not sure what to do, and hopefully one of you have had a similiar expierience and will be able to share your insight
First off, I don't like crontab -e , actually, not to offend anyone but I hate it. Isn't there a way to edit your own crontab with the editor of your choice?
I am use to editing my crontab file in root on my linux machine at home here using the command nano /etc/crontab
Unfortunately, since I don't have root to this box I'm on... (professionally hosted) I can't do that.
Is there any file where I could edit crontab using the editor of my choice, like... /home/jon/.crontab or something? -- This server is running on Redhat Linux 7.2 by the way, in case the file path may vary from distro to distro.
Now, let me present my problem that made me ask this question to see if you could if anything, help me with this.
You see, I'm not able to get a script to run, I've been adding it to webmin to execute at a certain time... then typeing date like a mad man in SSH waiting for it to go off...... it's time to execute goes by... and nothing ever seems to have happened. Spent 2 hours making the cronjob in
webmin trying to get it to work to no avail.
(Actually, I have gotton it to run once or twice... and then when I double-checked to see if it'd work within the next 5 minutes (to make sure I got it working and just not a 1 time thing... it didn't do a darn thing!!!... I'd then create a new cron entry and start over.....)
Thats why I want to add the cron manually, but without crontab -e
Here is a screenshot of the settings for crontab I have... you know.. the settings that don't execute when it's time to execute comes?
http://www.picrack.com/002/avatars/crontab1.JPG
I counted down for it to hit 5:00AM in the ssh console, typing "date" like I was crazy, and 5:00AM went by... 5:01,,, 5:02... 5:03... nothing ever happened, I didn't get "New mail" neither explaining any errors
Any ideas on how I would be able to get this to work... or add the crontab manually
WITHOUT using crontab -e?
A tack of the code I'm trying to execute, not that it probably matters though since it runs fine if I ./ it from ssh
Code:
#!/bin/bash
# A script that will back up pserver files by date and time.
# Here's how it works...
#1) Define your variables man!
#
#2) Create a tempdir e.g. July,07-03-2004-09:41:22AM.tempid=1088872882
# Basically, this creates a temporary dir with all the files in it
# it is given a temorary ID basted on amount of seconds since jan 1 1970
#
# I would have used %N which is nano seconds, but the server I coded this
# for apparently has an older version of date which doesn't support that sequence
#
#3) cp (copy) all the files youw want to back up to the new tempdir, simple enough, heh
#
#4) tarballz the items in the temp directory we made and copied stuff too
#
#5) delete the temp directory and its contents
instance=${1:-palace}
root=${2:-/home/jon/pserver}
temptime=${3:-`date +%B,%m-%d-%Y-%I-%M-%S%p.tempid=%s`}
#script written by Jon Kelley <jonkelley@gmail.com>
#I don't care if you use it or rip it apart or use it in a
#commercial product, just give me credit for it
/home/jon/pserver/bin/stop-palace
# ^^^ Stop server!
mkdir $root/$instance/psdata/backup/$temptime/
cp $root/$instance/psdata/pserver.pat $root/$instance/psdata/backup/$temptime/pserver.pat
cp $root/$instance/psdata/pserver.prp $root/$instance/psdata/backup/$temptime/pserver.prp
cp $root/$instance/psdata/pserver.prefs $root/$instance/psdata/backup/$temptime/pserver.prefs
cp $root/$instance/psdata/pserver.conf $root/$instance/psdata/backup/$temptime/pserver.conf
cp -rf $root/$instance/psdata/plug-conf $root/$instance/psdata/backup/$temptime/plug-conf
tar -cvzf $root/$instance/psdata/backup/`date +%B-%m-%d-%Y--%I-%M-%p`.backup.tgz $root/$instance/psdata/backup/$temptime/
/home/jon/pserver/bin/start-palace
# ^^^ Start the server back up!
rm -rf $root/$instance/psdata/backup/$temptime