0
votes
0answers
26 views

How can I queue a script to run the next time a system is up and connected to the internet? [migrated]

I'm using mailsend (on a Mac) to send mail from the command line. I'd like to set this up such that I can execute a send command, but if my system is disconnected from the internet, that command is ...
0
votes
1answer
201 views

Issue with ifconfig in a shell script (using cron)

If I execute this script manually in Debian: #!/bin/bash /sbin/ifconfig wlan0 down /sbin/ifconfig wlan0 up sudo iwconfig wlan0 essid "WLAN_NETWORK" sudo iwconfig wlan0 key myPassword sudo dhclient ...
1
vote
2answers
315 views

How to prevent termination of long-running Python script

I have a cron job running a Python script on a VM-based remote Ubuntu server. The script takes a couple hours to run, and I'm noticing the kernel appears to be terminating the script before it ...
0
votes
2answers
406 views

Debian webserver - Crontab error (not running php script)

I've a webserver with several sites and I'm trying to run a script by crontab but it gives me a error (126 and 127) My script is in: /var/www/site1/script.php When I run the command: php ...
2
votes
2answers
356 views

Running a script containing find with a regexp fails in cron but works in a shell

I have the following script in my /etc/cron.d: 19 15 * * * root /opt/scripts/clean-nexus-release-repo.sh The clean-nexus-release-repo.sh script looks like this: #!/bin/bash find ...
0
votes
1answer
148 views

Crontab start a screen

I started a screen by shell script in crontab, when I entered the screen, the left side became "sh-4.1#". While I runed the script directly, it was nomal with "[root@localhost data]". What happened? ...
-1
votes
1answer
267 views

Cron Script to Delete Folder Contents Every 5 Minutes on Media Temple [closed]

I'm not familiar with server-side scripting, but I'm currently using a PHP application on Media Temple to cache JPEGs from four webcams hosted on a server located in the middle of the Indian Ocean. ...
0
votes
4answers
349 views

crontab added line gone, but script is scheduled

I have a strange thing (i think), I added a line in my crontab on an QNAP NAS with crontab -e i saved (:wq!) This line would have had a script to run for every 5 minutes so i dit 5 * * * * and the ...
0
votes
1answer
125 views

Automate verification of script generated emails

We have over 100 servers that generate hundreds of emails every day using scheduled scripts (cron jobs) when the system/data is backed up or any other activity takes place. The email is sent to our ...
0
votes
1answer
275 views

Cron task failing on specific job

On my server I am getting the following error when running one of my cron tasks: CRON[9913]: (CRON) error (grandchild #9915 failed with exit status 127) The server is running ...
0
votes
2answers
182 views

Cron daemon's status check on production server

I have a script which need to be run as cron job. In the staging environment i could run the script as a cronjob. but in the production environment it is not working, so i checked whether cron ...
0
votes
3answers
195 views

Shell script does not work with cron

I have this shell script at /usr/local/1.sh: #!/bin/sh wget -r -np --user=peter --password='123' ftp://67.225.87.95/ -p /test/ If I run it using # sh 1.sh the script executes ok and does what ...
-2
votes
1answer
210 views

shell script doesn't run correctly in cron [closed]

I want to call a shell script I wrote from a cron. The shell script uses the program Linkchecker. If I run the shell script from the terminal it works just fine. However, when cron runs I get the ...
4
votes
6answers
14k views

script to automatically test if a web site is available

I'm a lone web developer with my own Centos VPS hosting a few small web sites for my clients. Today I discovered my httpd service had stopped (for no apparent reason - but that's another thread). I ...
1
vote
3answers
893 views

Problem using BASH in cron (FreeBSD)

Scenario: We have a legacy system running FreeBSD 4.7 (please, no laughing. It's being retired at the end of the year.. I just need to keep it alive and backed up until then) and I have some database ...
2
votes
3answers
2k views

Password less sudo in script

I have passwordless access to a server. My user account has added in sudoers file for NOPASSWD usage for some services/daemons in /etc/init.d/. I want to write a script to start or stop a daemon ...
3
votes
6answers
759 views

How to periodically remove all content from a file without deleting it

I need to periodically empty a text file without deleting it (I know how many lines it has). I tried this: Created a cron that executes the following script other lines from the script here sed ...
0
votes
3answers
522 views

cron job script - the script does not work from the cron (or it does not start)

I created a script to do something (after I reduced it just to echo "IS FINALLY WORKING" for testing purpose). If I type #bash /var/www/html/somedir/script.sh it works ok. The problem is that I ...
1
vote
2answers
2k views

run script with parameter in cron [duplicate]

I want to run .py script: python /home/project/manage.py slope_update If I run it from shell it's OK, but in cron does not work: */10 * * * * root python /home/project/manage.py slope_update ...
1
vote
4answers
397 views

How can I find automatically running scripts on a sever?

I need to find all the scripts on server which run automatically. The server crashed 2 times yesterday and I need to move all the cron scripts to move to backup server. Please tell me how to identify ...
0
votes
2answers
654 views

cronjob for centos/directadmin server?

hello i want to run a cron job on centos/directadmin server i want to run this page every minute. how i must do it? http://site.com/index.php?action=script
0
votes
3answers
74 views

Running a cronjob

've been puzzling over cronjobs for the last few hours. I've read documentation and examples. I understand the basics and concepts, but haven't gotten anything to work. So I would appreciate some ...
1
vote
5answers
824 views

How can I run a script from cron only once at a time?

I would like to run a cron job. Scheduling it is easy and works. My problem is that I don't know how to only have one version of itself running at a time. Any ideas? G-Man
2
votes
1answer
254 views

backup email log script spams me: crazed BASH expansion

I have a BASH script that "reads" the backup logs, reports the success/failure of the last backup, lists the contents of the backup directory then emails the results. After moving the backups to a new ...
0
votes
3answers
206 views

PHP Cron Job without PHP Binary?

I am looking to run a PHP script with a cron job, but it seems I don't have a PHP binary. Looks like I don't have PHP installed as a CGI, so without reinstalling/configuring my PHP, what is the best ...
1
vote
2answers
906 views

Bash Script to copy file across network unattended?

I would like to create a script that would execute a series of scp commands. This would pull a specific set of files from another computer on the network to a specific directory on the local machine. ...
0
votes
1answer
426 views

Script fails when run from cron

I have some embedded machines which are on an unreliable connection which network manager unfortunately isn't handling well. Currently I need to check for connectivity and then restart network manager ...
1
vote
1answer
2k views

redirecting output from telnet / nc to file in script fails when cron'd

So, I have device on my network which sits there listening on a port for a connection, and when a connection is made it dumps ascii data out. I need to capture that data to a file. I wrote a dead ...
2
votes
1answer
59 views

Are there any scripts to synchronize sites?

I've just set up a fail-over DNS to switch the site to a second host if the first is down. This is great for showing an old / archived version of the site, but I suspect maintenance is going to be a ...
2
votes
6answers
339 views

Cron is not available, what to use instead?

Several server accounts where I run some scripts to extract data from databases have very limited tools available and on some of them you are not allowed (even by formal request) to use cron, than ...
10
votes
5answers
8k views

Using mysqldump in cron job without root password

If I login with the root password on my box I can simply type mysqldump --all-databases and I will get th expected "Dump". I setup a job in cron.daily to run and dump this to a backup drive. The ...
1
vote
2answers
696 views

CRON job erratic behavior with Bourne shell script

I have the following script, that runs normally when I type the script name at the prompt (logscript): #!/bin/sh dvar=`date +"%m\/%d\/%y"` filedate=`date +%b%d%Y` echo DSS1 > ...
2
votes
4answers
768 views

DD copy works at terminal but not by cron

On an RHEL5.4 system I setup a script to backup a drive with dd copy every night by cron. I spit the dd output into a log file and email. It is in /etc/crontab and /var/spool/cron/root when I ...
1
vote
2answers
202 views

Best FTP Transfer Script

I am looking for a robust FTP transfer script that I can use with cron, any recommendations? I would love a script in Python that could run in the background.