Tag Info

New answers tagged

0

It is a known bug. The solution is to run: sudo apt-get purge policykit-1 sudo apt-get update sudo apt-get upgrade sudo systemctl reboot This issue started after I tried to install the firewalld package.


0

Cron and many command line tools are available. It is however not possible to safe any changes made to crontab unless you make your system partition writeable. The implications of making your system partition writeable and how to do it have been discussed in various posts. A work around has been suggested in this answer. It involves invoking a script with ...


0

The standard location for a script that must run at login is /etc/profile. It will then run for every user (once) when they log in. The user never gets to see the output of the script, it is logged If it is only for a specific user, it should be added to .profile in their home directory. With login I mean when you enter your username and password. Any ...


0

You should be able to move the script to a different location and then set up a cron entry (crontab -e) to run your script at your preferred days and time. Note that the format for root and normal users differs slightly. When executing crontab -e as root, each crontab line has one additional parameter to specify as which user to run the entry. Cron logs ...


1

sudo apt-get remove nano Have fun!


0

cron runs with a very minimal environment, as a result common environment variables will differ from what you are used to see in the shell. likewise PATH environment variable differs in cron. So if you want to run any binary in cron you have two options : Use the absolute path to the binary executable : 30 12 * * * /sbin/reboot Add PATH environment ...


0

15 * * * * /usr/bin/php /home/rizwan/PHP-workspace/mgstore/testcron.php >> /home/rizwan/cron.out this was working .but i have one php script,for adding customers from magento to ERP,when i run script manually,it asks for authorization,after accepting it creates customers into ERP from magento,I need whenever i added customer in magento after 5 or 10 mins ...


18

Testing result: If you add @reboot reboot This did not work!!! Why? $ which reboot /sbin/reboot Now When i added the full path of reboot, the cron job runs normally. So you got an infinite loop of rebooting in the case: sudo crontab -e And add the line: @reboot /sbin/reboot EDIT: If you want to get rid off this, you probably need to boot ...


0

In PHP you you can use either the backtick operator or the shell_exec() function to run a command in the system's default shell; you could run pgrep 'php /home/rizwan/PHP-workspace/mgstore/testcron.php' and evaluate its return code; either this: <?php if(!($PID = `pgrep 'php /home/rizwan/PHP-workspace/mgstore/testcron.php'`)) echo 'Process is ...


0

First you have to be sure to run the executable by complete path. you can get the path using which command $ which php /usr/bin/php Now the entry in crontab must be: 15 * * * * /usr/bin/php /home/rizwan/PHP-workspace/mgstore/testcron.php Now To check the output you can use redirection trick, so redirect the output to some file and then you can check ...


0

Ok, enough comments ;) … Edit your script an add the right shebang: #!/usr/bin/env python3


1

I had the same problem. I figured out while I selected an editor to create my cron jobs, I always used to rename the files with a suitable name I could identify. This time around I kept the name as suggested by system and did not rename the file. This is first time I was using crontab on my system. And it worked. I saw o/p on terminal saying installing ...


0

I guess this is pretty obvious but just to exclude this type of error I have to ask it. Does the second crontab really look like:22 20 * * * python /root/vine/hello.py (to run everyday at 20:22).If so then remove the part in braces because that's wrong or put a # in front of that part which makes it a comment.


3

rtcwake should be able to help you out here. sudo rtcwake -m mem -s 15 That should enter a S3 (memory) suspend for a few seconds, all your fans will shut off... And then and then boot right back up again without any state loss. Even network connections remain intact here. There is also a -m off mode. I'm going to assume you lose state completely here and ...


0

In my case, the message was hinting at a permissions problem with the bash script, but I couldn't see it until I installed an MTA. As suggested I ran: sudo aptitude install postfix I chose "Local" during setup and after running the cron job again: sudo tail -f /var/mail/<user> In my case I replaced <user> with "root". I was then able ...


2

As @Rinzwind says, you should run a script that should check if it's time to run, every 12 hours 0 0,6,12,18 * * * /path/to/script.sh The catch is that if you divide by 36 directly, it should have to run at 00 and 12 exactly, also it will skip the first day of the year. This script allows choosing arbitrary values for ~00 and ~36 hours #!/bin/bash # ...


0

Use two crontab lines, using date output to get the day of the year (date +\%j) and bc output to assign a 0, 1 or 2 to the day. Test the bc assignment. On the 1 days, run the job at 6 AM; on the 2 days, run the job at 6 PM; on the 0 days, do nothing. 0 6 * * * jd=`/bin/date +\%j`; /usr/bin/test `/bin/echo "$jd"\%3 | /usr/bin/bc` -eq 1 && job 0 18 ...


4

leafpad has a GUI, /bin/bash and /usr/bin/python not. You need a terminal emulator, eg lxterm. * * * * * env DISPLAY=:0 lxterm -e "/bin/bash -c '/usr/bin/python /scripts/mypython.py'" or a bash: * * * * * env DISPLAY=:0 lxterm -e "/bin/bash"


0

The problem is in crontab. I solved it with this line: @reboot sh /path/to/sh-script and in the script I put cd /path/to/rails-app && /usr/local/bin/rails s Thank you


0

After all I occured it was memory problem. I didn't set maximum memory for Jetty so it tried to allocate 1/4 of all memory. Also I have found final solution for such problems here: OOM killer not working?


0

In searching around I came across a better script and decided to try it, and it works: #!/bin/bash PATH=/usr/sbin:/usr/bin:/sbin:/bin if [[ ! "$(/usr/sbin/service mysql status)" =~ "start/running" ]] then echo "MySQL restarted" | mail -s "Email Subject" email@domain.com sudo service mysql start fi More info can be found here ...


0

00 02 * * * DISPLAY=:0.0 steam (Thank you to muru for giving me the clue to figure this out!) This line in cron will start Steam every night at 02:00 (2:00AM). The breakdown is this: the first part is standard cron "minutes, hours, days (of the month), months, days (of the week)", so the 00 means at zero minutes past the hour; the 02 means at 2 on the 12 ...



Top 50 recent answers are included