Tag Info

New answers tagged

0

Found that AIX handles it via smitty topas. Interesting.


0

Double check that selinux isn't the issue (as root): audit2allow /var/log/audit/audit.log Depending on the issue you can generate a policy to allow: audit2allow -m local-log-script -o local-log-script.te /var/log/audit/audit.log Edit that so it only has what you need for your script and then generate and import the selinux policy file: checkmodule -M ...


0

Assuming you have the read/write privilege to /etc/crontab file, then it should include username in the job line as follows: crontab -l -u username 25 11 * * * username /logs/scripts/chim/currbalance_dump.sh >> /logs/currbal.log User specific cron job scripts can be found at /var/spool/cron/username Also, make sure the bash script has ...


0

Found an answer to my own question. Cron does not set the environment variable USER. Thus, one solution is to run mbsync from inside a script like this: #!/bin/sh USER="YOURUSERNAME"; export USER mbsync gmail


2

Common mistake, wrong order of redirection, try this: … sendmail_alive.sh >/tmp/sendmail_alive.log 2>&1 It works like this: file descriptor stdout to /tmp/sendmail_alive.log file descriptor stderr to the value of stdout (/tmp/sendmail_alive.log) With your order, you first point the stderr where originally was stdout and you get the stderr ...


2

Create one cron entry that is: */5 * * * * processA ; sleep 10 ; processB ; sleep 10 ; process C However, I recommend against this. I wouldn't use cron at all. Cron is not that smart. If you tell it to run a job every 5 minutes, and the job takes 6 minutes to run, you will get 2 processes running. By the end of the day you'll have dozens or hundreds of ...


2

There is no option is cron to get to units of seconds. Instead, make use of sleep. For example, in case those are all shell scripts: Set the cron for the 1st script as usual. Add sleep 10 to the second script so that the actual execution starts after 10 seconds. Add sleep 20 to the third... and so on.


1

That crontab entry is invalid, maximum value for hours is 23, not 24. Hence that line is rejected. You should have gotten an error after adding it.


4

You can use word notation for more readability : kill -STOP <PID> # pause kill -CONT <PID> # continue working Check man 7 signal


0

This feature has already been implemented in systemd (ver >= 212) using the "Persistent" directive so you just need to insert "Persistent=true" in the unit file while using "OnCalendar" directive to establish the date/time to run the job.


1

The @reboot entry is there for doing things after each reboot. That is not what you want. Cron is not the right tool for this, as it starts something at a specific time and it has no clue about you being logged in or being in the process of logged in. At most a cron job run every minute could look if you are logged in and then take action. It is better to ...


1

I totally forgot that awsetbg is just shell script which uses $HOME variable. awsetbg - awesome wrapper tool to set background So HOME needs to be set. * * * * * ad DISPLAY=:0,HOME=/home/ad /usr/bin/awsetbg -a -r /home/ad/img/beauty/ If you will use directly some app, it will work just with DISPLAY env: * * * * * ad DISPLAY=:0 feh --bg-max ...


1

I guess it's changing HOME=/ to HOME=/home/ad.


1

Your failover system must have some network characteristic that distinguishes it from the real one. Unless you have an especially complex setup, the two servers have different IP addresses. On the recipient machine, check the earliest (last) Received: header: this header indicates which machine sent the email (from the perspective of the first hop). Use a ...


0

You would be much better off using tmpwatch tmpwatch recursively removes files which haven't been accessed for a given time. Normally, it's used to clean up directories which are used for temporary holding space such as /tmp.


1

Change the 'From' text by editing /etc/passwd to receive mail from 'root at failover' instead of just 'root'. chfn -f 'root at failover' root source: https://wiki.archlinux.org/index.php/SSMTP


3

A crontab created with crontab -e and listable with crontab -l should not have a user specified for the command. Your entry should read: * * * * * /home/test.sh Or alternatively put the line that you have in /etc/crontab instead. From man 5 crontab (section EXAMPLE SYSTEM CRON FILE): # /etc/crontab: system-wide crontab # Unlike any other crontab you ...


0

Have a look in your cron Configuration file. Maybe your cron-job is run as an specific user which does not have access to everything. Also its a clever idea to write log-files so you can see what exactly your script does when run by cron.


-1

You can read http://tutscode.com/how-to-use-crontab-in-linux/ to get more information about crontab.


3

They work immediately after saving


0

Setting options with shopt is a shell setting. It only affects the shell instance that you run it in: it is local to the shell process and to subshells invoked by $(…), (…) and similar constructs. It has no effect on other shell scripts executed concurrently or later, nor even on independent bash scripts that happen to be executed from commands executed by ...



Top 50 recent answers are included