0
votes
2answers
23 views

Synchronized script execution across multiple servers

I'm looking to run an automated task (a shell script) on multiple Ubuntu servers at the same time with as much timing accuracy as possible. Ideally, I'd like the time discrepancy between the start of ...
0
votes
2answers
43 views

Is there any reason this cronjob would fail in cron, but not on the command line?

I have written a little one liner that will email me when a list of files changes - I used sha512 to generate a list of hashes and then periodically check that those hashes still match. */5 * * ...
0
votes
0answers
31 views

How to run browser in background in Ubuntu

I am using Ubuntu 14.04, and PHP. I have 2 files: test.html - content java to test network update.php - the test file will post result to update database. I need to run and execute an URL address ...
0
votes
1answer
131 views

Ubuntu Cron ec2-create-snapshot

I have a new ec2 Ubuntu instance running. I have properly set up the ec2-api tools. I want to create a daily backup using the ec2-create-snapshot command. Just to test it, I have my script, which is ...
0
votes
1answer
60 views

Back up (save) the same file at periodic intervals

I am saving a stream in my HDD. I'd like to copy the file periodically into a subfolder backup such that the older versions of the the file are not deleted. Simply put Assume the original file is ...
1
vote
3answers
2k views

Why does this script fail when run from cron, but works when run manually?

I have a relatively simple bash script that works great when invoked directly, but fails when run by cron. Why does this fail and how can I make it work via cron? #!/bin/bash apt-get update -y ...
0
votes
1answer
335 views

Why does this bash script give an error on Ubuntu but not OSX

#!/usr/bin/env sh export $NODE_CONFIG_DIR=/Users/full/path/to/script/config cd /Users/full/path/to/script /usr/local/bin/node main The script runs locally on OSX (if I adjust the paths for the local ...
0
votes
1answer
200 views

Cron unable to run shell script

I have been trying to get a shell script to run for hours using cron to no avail. I am trying to have the following bash script run every minute #!/bin/bash ...
1
vote
1answer
272 views

Ubuntu start Node.js server and open Chrome in kiosk mode

I'd like for a computer to immediately start a Node.js application on boot. I'd then like Chrome to open in Kiosk mode, but only after the server has been started. Looking on the Ubuntu Stack ...
0
votes
1answer
158 views

Ubuntu — Application global environment variables

So I have an application I am deploying to an Ubuntu 12 server. My application has several "parts" to it: There's a web server, run as part of an upstart script There are cron jobs There are ...
0
votes
1answer
92 views

Reset user password on reboot

Humor me for a moment because I'm aware that this is a terrible idea. I'm trying to devise a way to reset a user's password each time the computer is rebooted. So far, I've tried the following to no ...
0
votes
3answers
867 views

How to schedule/unschedule cron job from shell

I have a ubuntu server where I put my application core. It's a jar that needs to be always listening for requests. I made a script to run it with the correct parameters. The scenario is similar to ...
0
votes
3answers
190 views

Automatically Create text file of folder contents

I have a set of directories that have files in them for use with LiquidSoap for use with IceCast2 Currently, every time I remove a file or add a file, I have to edit the txt file listing the mp3s to ...
0
votes
1answer
143 views

Does cron still run for disabled users?

If a user is disabled (with passwd -l user) on a server, are their cron jobs also disabled? Or would they still run?
2
votes
2answers
754 views

Working with git via crontab

I have the following shell script #!/bin/bash REPODIR=$HOME/work/repository/ cd $REPODIR var=`git fetch --dry-run 2>&1` echo $var > $HOME/error.txt I want to run my script every minute, ...
0
votes
1answer
237 views

Crontab doesn't run my script Ubuntu

My script is located in /opt/restart-hlasic.sh restart-hlasic.sh contains: #!/bin/bash SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/ SERVER="XXX" ...
0
votes
1answer
45 views

Crontab comments on same line as job seem to cause issues

Can you put a comment on the same line as a cron job? Example: * 19 * * * lnxuser rm /home/lnxusr/edi/logs/mcfg204_`date -d -8days +\%Y\%m\%d`.log #THIS IS TO WIPE A 204 LOG THAT IS OLDER THAN A ...
0
votes
2answers
248 views

crontab not working properly

When I run a script manually using root it is working fine. when I execute the same script inside cron it is not running. I checked the cron is actually calling the script but the script is not ...
0
votes
2answers
933 views

Execute a root command every 24 hours after startup

I want to execute a command as root on an Ubuntu 11.04 machine every 24 hours. This machine is not on all of the time, but when it is, it can be left on for days at a time. How should I correctly ...
2
votes
5answers
1k views

rsync works fine until I put it in crontab (UPDATE: 'date' doesn't work in crontab)

I've got this rsync command that works just fine when I run it from the command line (Ubuntu Server 12.04.1 LTS). I'd like it to run every hour, on the hour, and output the results (along with errors) ...
2
votes
1answer
937 views

Cron jobs are running but there is nothing in crontab? Have I been hacked?

I have a server that's been running for years now and there are no cron jobs set up. I have not logged in or changed anything in months. Suddenly I started receiving emails that look like this, about ...
1
vote
1answer
1k views

cron job when Ubuntu is suspended

I am using Ubuntu precise. Is there a way to have scheduled cron jobs run even when Ubuntu is suspended? Perhaps some way to automatically wake up the system so a scheduled cron job can proceed and ...
1
vote
2answers
3k views

Error in Ubuntu, what does this mean?

Got this on my machine. I was just browsing the web on Chrome and my computer froze. I recently just built this machine. I have a feeling it is a hardware problem... Possibly one of my parts arrived ...
3
votes
1answer
13k views

Why is my crontab not running

I have this cron 38 * * * * /bin/bash -l -c 'cd /var/rails/site/releases/20120705144335 && script/rails runner -e qa '\''Play.load_lists'\''' I have this cron under the a different user so ...
1
vote
0answers
906 views

Why does cron task run twice?

I have a task that should run each day in Ubuntu10.04. So I use crontab and copy the scripts of the task to the directory /etc/cron.daily. Here is the my crontab: # /etc/crontab: system-wide crontab ...
1
vote
0answers
291 views

What happens if cron.daily is not terminating

Today I had to realize that some cron jobs werent run on my server! In the log files I find this: Mar 13 03:30:01 osp-server anacron[7261]: Anacron 2.3 started on 2012-03-13 Mar 13 03:30:01 ...
-1
votes
1answer
469 views

Running transmission-gtk under cron

I have a problem with cron on Ubuntu 10.04 and 11.04. crontab -e I have typed: 49 22 * * * /usr/bin/transmission-gtk I have also tried: sudo /etc/init.d/cron restart pgrep cron
0
votes
2answers
2k views

FTP from bash script running from cron not working

I have a script that is run by cron to create backup of a MySQL database and some files. After creating a tar ball and encrypting it with openSSH I have to put it on a remote ftp server. Following is ...
2
votes
1answer
675 views

How do I stop display and another email of changes when running aptitude full-upgrade after receiving apticron email notifying of the same changes?

My home server used to run Ubuntu 10.10 server with apticron installed, which periodically (via cron) sends emails when updates to your installed packages are available. This email includes a list of ...
2
votes
1answer
430 views

Scheduled Push Changes To Local Git Repository (Ubuntu)

Boring Background - Summary: I know we're not using GIT properly!. This started as a small hobby project and has spiralled - my company uses Git to track/manage changes to a bespoke web-based software ...
6
votes
4answers
8k views

bash: using scp in cron job fails, but runs succesfully when run from command line

I am trying to use scp in a bash script run by cron (I am running this on Ubuntu 10.0.4 LTS). The script works fine (i.e. transfers and copies file1 and file2 to/from the remote server, when I run it ...
0
votes
0answers
1k views

Running a bash script at random times using cron job

I need to monitor intrusion on a server at (relatively) random intervals. For that I have set up a cron job to run every hour. I have written three scripts: wrapper script that calls a ...
2
votes
2answers
1k views

How can I change the cron?

I have a script that I want to be run every X minutes. I already have the cron sentence I need to paste to the cron, but can't find it anywhere. The terminal command 'crontab -e' works, but it opens ...
2
votes
3answers
8k views

How do I create several screen sessions on startup in Linux?

Firstly, what's the best way to execute commands on startup, cron? Can I use su in a shell script to switch between different users, if so how? How do I create several detached screen sessions on ...
1
vote
2answers
571 views

Why is bash rsync script not writing anything to file?

Ubuntu 9.10 crontab -l 0 1 * * * /root/cron/rsync-93.193.99.111 &> /root/cron/rsync-93.193.99.111.log 0 3 * * * tail -100 /root/cron/rsync-93.193.99.111.log | msmtp me@myemail.com ls -l ...
0
votes
2answers
2k views

How do I write a bash script to detect a mounted USB drive?

I'm triggering a script from cron. I want it to run rsync ONLY if a USB disk called "data_3" is mounted, otherwise not. How do I write a bash script to detect a mounted USB drive ? My current ...
4
votes
2answers
1k views

Can Ubuntu play a video via cron job?

I'm developing a display system for a paint shop. I've set up a computer with Ubuntu to run the video and display it on a TV, running a PHP script that should update the video every hour via the ...
1
vote
4answers
364 views

Ubuntu Backup Cronjob

I was wondering if someone could give me a quick script that I could run via cron that would backup my entire /var/www directory? I just want it to run once a day at 3:05am, and to put the copy in ...
19
votes
3answers
38k views

How to run a cron job as a specific user?

I would like to run a cron job as a specific user on my machine. How may I specify the user for a cron job to run as?. I am running on Ubuntu 10.0.4 [Edit] The cron jobs will be running on a ...
2
votes
3answers
8k views

Crontab not working in Ubuntu 10.04

I installed it in a machine at work and it wouldn't do anything, no matter what I did. So now I have it on virtualbox at home and it also doesn't work. Here's what I'm trying to do: Have a file on ...
3
votes
4answers
9k views

Verify that a cron job has completed

Is there a command that can be run to verify that a users cron job has run successfully? Platform is Ubuntu 8.04 LTS. I have scripts in /home/useraccount/bin/ running crontab -l while logged ...
1
vote
1answer
297 views

Running git-svn with cron results in garbage in .git

I've setup a git-svn repo with cron to fetch from the svn repo daily. I have a script to do the fetching, and this is what is invoked by cron. Everything is fine with the repo, and the script works ...
19
votes
5answers
26k views

How can I view results of my cron jobs?

I see so many guides on how to run crontab, but what I need right now is to learn how to Find log files about cron jobs Configure what gets logged
4
votes
4answers
1k views

cron runs but nothing happens

I have created a script called "forward_email.sh" and set permissions to 777. It contains the following line: echo "It worked: $(date)" >> /home/noc/email.log I created a cron job with the ...