I’m a long time user of Linux but new to Opensuse. My anacron jobs are not running.ls -l /var/spool/cron/lastrun/total 0-rw-r–r-- 1 root root 0 Jan 26 19:30 cron.daily-rw-r–r-- 1 root root 0 Jan 27 06:30 cron.hourly-rw-r–r-- 1 root root 0 Jan 26 19:30 cron.weeklyI checked cron is running -pidof cron8806and restarted itSystemctl restart cronbut no joy.My root crontab was empty so I added the following lines based on wikicrontab -l# DO NOT EDIT THIS FILE - edit the master and reinstall.# (/tmp/crontab.qX9idm installed on Sat Feb 14 19:26:28 2015)# (Cronie version 4.2)# cat /etc/crontabSHELL=/bin/shPATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/binMAILTO=root## check scripts in cron.hourly, cron.daily, cron.weekly, and cron.monthly#-*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1 I also installed anacron-croniels -l /usr/lib/cron/total 8-rwxr-xr-x 1 root root 7735 Oct 6 08:40 run-cronsWill appreciate any helpthanks for reading
I’m a long time user of Linux but new to Opensuse. My anacron jobs are not running. Reposted with slightly better formatting.
ls -l /var/spool/cron/lastrun/total 0-rw-r–r-- 1 root root 0 Jan 26 19:30 cron.daily-rw-r–r-- 1 root root 0 Jan 27 06:30 cron.hourly-rw-r–r-- 1 root root 0 Jan 26 19:30 cron.weekly
I checked cron is running -pidof cron8806
and restarted itSystemctl restart cron but no joy. My root crontab was empty so I added the following lines based on wiki
crontab -l# DO NOT EDIT THIS FILE - edit the master and reinstall.# (/tmp/crontab.qX9idm installed on Sat Feb 14 19:26:28 2015)# (Cronie version 4.2)# cat /etc/crontabSHELL=/bin/shPATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/binMAILTO=root## check scripts in cron.hourly, cron.daily, cron.weekly, and cron.monthly#-*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1
I also installed anacron-croniels -l /usr/lib/cron/total 8-rwxr-xr-x 1 root root 7735 Oct 6 08:40 run-crons
Will appreciate any helpthanks for reading
Please, it is a rather hidden feature on the forums here, but we use CODE tags for showing computer text in the posts. It is the # button in the tool bar of the post editor. Copy/paste the computer text directly from your terminal window in between them. You get then something like:
henk@boven:~> LANG=C ls -l /var/spool/cron/lastrun/
ls: cannot access /var/spool/cron/lastrun/: Permission denied
henk@boven:~>
(you will probably get a different result, but it is the layout that counts in this example).
Another thing is that you do not tell us what version of openSUSE you are using.
Then a bout Anacron. I know it can be installed, but I do not think it is very often used in openSUSE.
The /etc/cron.daily, etc. directories are there to be used, and I am almost sure that they still function.
And using root’s crontab is just like using any user’s crontab. Hasn’t much to do with anacron imho.
Maybe you can explain what you want to achieve instead of asking about the step you are taking.
I’m using opensuse 13.2 and I’m trying to run a backup script i wrote and is in /etc/cron.weekly
btw i cant see any toolbar when I post this. I tried to see it using firefox and konqueror but no toolbar is visibly
Well, when you wrote (and tested?) a script, put it in /etc/cron.weekly (and of course set he appropriate permission for read and execute), then this should function IMHO. I assume that you think it does not, but you do not realy say so and certainly not how you came to that conclusion. Nor did you show us anything to enable us to comment on what you did.
Thus please show us
ls -l /etc/cron.weekly
and the contents of that script (or at least the start of it)
head /etc/cron.weekly/<the-script.>
But please after you mastered to CODE tags (you can also enter them manualy:
...... / CODE], where I have an extra space betwwen the / and the C, do not put that space there when you use this way of doing.
[quote="vikramr,post:4,topic:106930"]
Ibtw i cant see any toolbar when I post this. I tried to see it using firefox and konqueror but no toolbar is visibly
[/quote]
You do not get a page with a post composer complete with tool bar, smileys to add, extra options, and a lot of such fuzz when you click the "+ Reply to a Thread" button below (or above) the thread?
Or the same when you click "Reply with Quote" below a Post?
I have attached the code you asked for. Its a simple backup script i have been using for years and workedif its working I get 2 files like so
choma-laptop:~ # ls -lh /bac
total 424M
-rw-r--r-- 1 root root 249K Dec 20 16:04 archive-2014-12-19.log
-rw-r--r-- 1 root root 6.1M Jan 26 21:17 archive-2015-01-25.log
-rw-r--r-- 1 root root 417M Jan 26 21:17 backup-2015-01-26.tar.gz
-rw-r--r-- 1 root root 403 Jan 26 21:16 backups.log
-rw-r--r-- 1 root root 120K Jan 26 21:17 incremental-backup-baseline
and also
It worked for a few weeks and not sure why it stopped running after Jan 26th.
choma-laptop:~ # cat /backup/backups.log
creating new archive /backup/backup-2014-12-20.tar.gz
creating new archive /backup/backup-2014-12-23.tar.gz
creating new archive /backup/backup-2014-12-24.tar.gz
creating new archive /backup/backup-2014-12-24.tar.gz
creating new archive /backup/backup-2015-01-26.tar.gz
Doing full backup - deleting incremental baseline Mon Jan 26 21:16:38 PST 2015
creating new archive /backup/backup-2015-01-26.tar.gz
ls -l /etc/cron.weekly/
total 0
lrwxrwxrwx 1 root root 33 Dec 20 21:53 backup -> /home/vikram/bin/backup/backup.sh
choma-laptop:~ # cat /etc/cron.weekly/backup
#! /bin/sh
archivedir=/backup
archive=$archivedir/backup-`date +%Y-%m-%d`.tar.gz
backup_file_list=/home/vikram/bin/backup/backup_file_list
exclude_file_list=/home/vikram/bin/backup/exclude_file_list
if $# -ge 0 ]
then
if $1 = "full-backup" ]
then
echo "Doing full backup - deleting incremental baseline" `date` >> $archivedir/backups.log
rm -f $archivedir/incremental-backup-baseline
fi
fi
echo creating new archive $archive >> $archivedir/backups.log
tar -czv --absolute-names --files-from=$backup_file_list --exclude-from=$exclude_file_list \
--listed-incremental=$archivedir/incremental-backup-baseline -f $archive >> $archive
2>> $archive
I also checked i have adequate space and able to write on the /backup directory.
I finally figured out why I didnt get the toolbar. I have a firefox addon to spoof browsers at random to preserve my privacy. when i switch if off it appears now.
I cant explain it but its working now. I also checked the system journal and anacron didnt run from Jan 26th to Feb 16th only cron. anyways thanks for reading this.
Well, nice it runs, but a bit unsatisfuing that we do not know what happened
You are welcome in any case.