Results 1 to 6 of 6
Thread: Cron does not work
-
11-10-2009, 11:22 AM #1WHT Addict
- Join Date
- Mar 2006
- Posts
- 160
Cron does not work
Hey,
I've got a script that is suppose to dump a sqlite database daily works fine via SSH but when put in a cron it gives this error:
Online database dump in progres please wait...
/backup/scripts/murmur_sqlite: line 10: /backup/mumble/$DAY-$TIME.sql: ambiguous redirect
DONE!
Heres the script:
Code:#!/bin/bash # Mumble SQLLite Database Live Dump echo "Online database dump in progres please wait..." TIME=$(date +%k%M) DAY=`/bin/date +%d%m%Y` #echo "$DAY-$TIME" sqlite3 /mumble/murmur.sqlite .dump > /backup/mumble/$DAY-$TIME.sql echo " DONE!"
Thanks,
Tom
-
11-10-2009, 11:40 AM #2Web Hosting Master
- Join Date
- Oct 2009
- Posts
- 1,063
Once make sure the crond service is running on the server if not restart the crond service by using,
#service crond restartShared Hosting | Reseller Hosting | VPS Hosting | Dedicated Servers
KeserHosting.Com
-
11-10-2009, 12:10 PM #3Junior Guru Wannabe
- Join Date
- Aug 2009
- Posts
- 79
Its ambiguous redirect because you are not redirecting to single file.
-
11-10-2009, 01:05 PM #4WHT Addict
- Join Date
- Mar 2006
- Posts
- 160
How do you mean? The script just redirects the output from the sqlite command to a single file based on the time/date. I'm not attempted to direct to multiple files (Or as far as i'm aware).
Also the cron does run thats not the issue - the error I quotes comes from the mailbox of the user who ran the cron.
-
11-10-2009, 01:22 PM #5Aspiring Evangelist
- Join Date
- Mar 2009
- Location
- /home/khunj
- Posts
- 433
The %k parameter will output one space char before the digit if the hour value is lower than 10 : ' 0', ' 1', ' 2' etc...
Using %H should solve the problem as it will always display 2 digits: '00', '11' etc
You can also only run the date command once :
Code:DAY=`/bin/date +%d%m%Y-%H%M` sqlite3 /mumble/murmur.sqlite .dump > /backup/mumble/$DAY.sql
NinTechNet
★ NinjaFirewall : Web Application Firewall for PHP and WordPress.
★ NinjaMonitoring : Monitor your website for suspicious activities.
-
11-10-2009, 01:42 PM #6Web Hosting Master
- Join Date
- Mar 2009
- Posts
- 2,222
Similar Threads
-
Cron Times, hwo to setup a cron to run every 15 mintues?
By build-a-host in forum Running a Web Hosting BusinessReplies: 5Last Post: 02-22-2008, 04:54 AM -
Cron job Help: Can any one Help with Commands for Cron Jobs????
By pal_web in forum Hosting Security and TechnologyReplies: 4Last Post: 06-16-2006, 02:43 PM -
run-parts /etc/cron.daily & Anacron job 'cron.daily problems
By 0218 in forum Hosting Security and TechnologyReplies: 0Last Post: 12-12-2004, 10:24 PM -
RAQ3 Mail warning: Cron <root@....> run-parts /etc/cron.daily
By PGF in forum Dedicated ServerReplies: 1Last Post: 01-11-2003, 06:57 PM -
HELP! Cron <root@ws1> run-parts /etc/cron.daily
By Domenico in forum Dedicated ServerReplies: 2Last Post: 04-03-2001, 06:15 PM