LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-11-2006, 05:25 AM   #1
pietrob71
LQ Newbie
 
Registered: Jun 2006
Posts: 3

Rep: Reputation: 0
Mondoarchive via cron


UBUNTU BREEZE 5.10

I have a script -> /usr/bin/backup

--------------------------------------------------------------------------------------------------
rsync -a --delete /var/www /home/max/backup/
mysqldump --all-database --opt > /home/max/backup/mysql_backup.sql
rsync -a --delete /var/mail/virtual /home/max/backup/

umount -f /dev/cdrw
mondoarchive -OVegFw 4 -9 -I /home/max/backup/ -d /dev/cdrw
--------------------------------------------------------------------------------------------------

from my shell with "sudo backup" everythings work fine and I obtain a CD with my backup

This is my root crontab

0 3 * * * /usr/bin/backup

At 3:00 am of every day the script is executed, because I can see the correct day and time of mysql_backup.sql, but the line of mondoarchive is not executed and cd is not burned.

Then I have find on google an howto: (in google search for "mondoarchive cron howto")

but when I type: "grep mondo /var/spool/at/*"

the system tell me: "grep: /var/spool/at/*: No such file or directory"

I hope someone can help me.

Thanks in advance

Pietro
 
Old 06-11-2006, 05:50 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
I don't know what you are looking for in /var/spool/at/. Perhaps you are confusing "at" with "cron" and getting /var/spool/atjobs/, or /var/spool/atspool/ wrong also.
Quote:
from the man page:
DIAGNOSTICS

Mondo generates two additional, and Extremely important files: /var/log/mindi.log and /var/log/mondo-archive.log. When seeking technical support, attach these two files to your email.
The -g option is for gui mode which won't work in a cron job. If mondarchive outputs on stderr during it's operation you may need to redirect the output to prevent the job from being blocked.
Are you using cd-rw discs? If not the -w option may cause it to fail because it can't erase a cd-r disk. But your device /dev/cdrw indicates this is not the case.

Good Luck!

Last edited by jschiwal; 06-11-2006 at 05:56 AM.
 
Old 06-11-2006, 07:33 AM   #3
pietrob71
LQ Newbie
 
Registered: Jun 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jschiwal
I don't know what you are looking for in /var/spool/at/. Perhaps you are confusing "at" with "cron" and getting /var/spool/atjobs/, or /var/spool/atspool/ wrong also.


The -g option is for gui mode which won't work in a cron job. If mondarchive outputs on stderr during it's operation you may need to redirect the output to prevent the job from being blocked.
Are you using cd-rw discs? If not the -w option may cause it to fail because it can't erase a cd-r disk. But your device /dev/cdrw indicates this is not the case.

Good Luck!
For -w option-> I'm using CDRW
For -g option-> It's a my mystake

I'm not confused "at with cron", I have only follow the howto instruction.

-------------- This is a crucial part of howto
Use the 'at' command to submit your usual mondoarchive command. My mondoarchive command is:

mondoarchive -D -Ow 10 -S /home/mondo/ -T /home/mondo/ -g \
-E "\"/home/cdaly/GIS/W2K /home/mondo/\"" -9

To submit the mondoarchive command with 'at' do:

at now + 5 min
mondoarchive -D -Ow 10 -S /home/mondo/ -T /home/mondo/ -g \
-E "\"/home/cdaly/GIS/W2K /home/mondo/\"" -9
<CTRL>-d

This generates a script in /var/spool/at/ which sets up your environment and runs your command. Grab this script to become your cron job.

--------------

I would like to know this: when I using the "at" command where are writed the scripts on my ubuntu breeze?
Otherwise: how can I launch mondoarchive with cron?
 
Old 06-12-2006, 05:30 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
"at" is used to run scripts at a particular time once. When you use cron instead, that is a different program which runs your script on a regular schedule. There is a /var/spools/cron/lastrun/ directory, but that will probably just tell you when a script was run.

The mondoarchive itself probably produces a log, so you will need to check it's documentation.
You could also have a line like 'echo >/var/log/messages "mondoarchive started $(date)" '
in your script.

Looking in the manpage for the "at" command, there is no /var/spool/at mentioned. Check the manpage on your system.

If the mondoarchive command produces output on the console as it runs, or expects terminal input, that could cause a problem. If that is the case look for a quiet option.

Last edited by jschiwal; 06-12-2006 at 05:32 AM.
 
Old 06-13-2006, 03:24 AM   #5
pietrob71
LQ Newbie
 
Registered: Jun 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Problem solved

Quote:
Originally Posted by jschiwal
"at" is used to run scripts at a particular time once. When you use cron instead, that is a different program which runs your script on a regular schedule. There is a /var/spools/cron/lastrun/ directory, but that will probably just tell you when a script was run.

The mondoarchive itself probably produces a log, so you will need to check it's documentation.
You could also have a line like 'echo >/var/log/messages "mondoarchive started $(date)" '
in your script.

Looking in the manpage for the "at" command, there is no /var/spool/at mentioned. Check the manpage on your system.

If the mondoarchive command produces output on the console as it runs, or expects terminal input, that could cause a problem. If that is the case look for a quiet option.
With command "at" UBUNTU BREEZE 5.10 place the script in /var/spool/cron/atjobs/

Now I have followed the howto and everything works right.

Thank you Jschiwal
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
cron.allow and cron.deny in slackware? tl64 Slackware 5 10-13-2005 09:44 PM
No More Cron Mail, Cron Error? Xhost Linux - General 3 07-26-2004 04:28 PM
[cron][mdk9.1]cron deamon seems to ignore some task... yannrichet Linux - Newbie 5 06-26-2003 09:57 AM
dual entries in cron log for cron.daily cpharvey Linux - General 3 02-27-2003 02:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration