Server :: Script Works When Run But Not When Called By Cron

Aug 28, 2010

I've made a bash script to do scp a file from another server and tested it successfully by executing it manually. However, when I scheduled it by cron, I received a mail from root saying permission denied.

The script is at:

It's supposed to secure copy a file from a remote host to:

The script's content is (No need to supply password as I've done the ssh-keygen thing):

Code:

From what I can make out of the mail, it appears that it has problem saving it to the /home/backup directory.

View 7 Replies


ADVERTISEMENT

Server :: Gawk Works From Command Line But Not From Cron

Jun 5, 2010

I have a very simple gawk script to add commas to numbers to make them more readable:

It works perfectly from the command line, but when run from cron it doesn't add the commas.

View 2 Replies View Related

Programming :: Loading Environment Into Bash Script Called By Cron?

Mar 18, 2010

Script programming question for the experts. I have written a bash script that works fine if I execute from the shell interactively. However, once I schedule it to be executed via cron, it just wouldn't work. I believe this has to do with cron running in a different environment than the one I am in when I putty in.

The bash shell script does refer to environment variables in the .cshrc file. I guess these aren't available to the cron? How can I load them into the script if I want them to be available to the cron locally within the script?

View 1 Replies View Related

Ubuntu :: Bash Script Works Partially In Cron?

Sep 24, 2010

I have a script that pops up a jpg file several times a day as a reminder. The script is called up by crontab and it works perfectly.The issue is that I want the script to also perform a system "beep" in addition to popping up the jpg file. When I test it on the command line everything works but when I run it in cron the jpg file pops up but the beep doesn't beep. I'm thinking the problem is in the "echo -e \a" part. I must be missing something.Here is my script:

#!/bin/bash
echo -e \a
sleep01; echo -e \a

[code]....

View 8 Replies View Related

General :: Bash Script Works In Terminal But Not In Cron?

Feb 17, 2011

I'm really running into a wall trying to figure this out. I have a Bash script and narrowed down the one command that doesn't seem to work via cron and it's my pgp decrypting line. Works fine if I run the command via terminal but if I run it via cron it doesn't output anything.crontab -e shows the cronjob and it runs, creates the log file with no output. Is there maybe something I need to run as well? Permissions look set, unless the cron is running as a different user(was under the assumption if it showed up under crontab while logged into that user, then it would run as that user.

View 14 Replies View Related

Programming :: Destructor Called On Objects In Deque Without It Being Called Explicitly

Jul 13, 2011

I feel there's a bit of a misunderstanding going on between C++ and me...My problem is that I have a deque of pointers to a class, and create objects then add them to the deque in a for loop. However, the destructor is called on the object as soon as the loop quits.

Code:

This prints:

Code:

Now, if I change the deque from deque<Test*> to deque<Test> then it works fine - I get:

Code:

However, I can't do this with my actual code, because I am creating a deque of pointers to an abstract class, so it won't let me instantiate the class. (This is all so that I can take advantage of polymorphism, and call functions on a set of similar objects without worrying what type of object I'm dealing with).

So, I suppose my question is: what is the correct way to create that deque of pointers to the abstract class? I don't seem to be barking up the right tree currently.

View 4 Replies View Related

General :: Exactly Which Files Are Called When I Login Into Server ?

May 11, 2011

Exactly what sequence of files are called as in the .my_profile,.profile,.vimrc,.vim. These are few files that I are there on the server. I want to know which file is called first and what sequence. Also can you point me to some links that tell exactly what are these files for.

View 1 Replies View Related

Security :: The Server Was Hacked From So Called Tor IP Address?

Nov 14, 2010

I always use professional services to secure my servers. Everything was fine for years but a week ago my server got hacked.I don't know how the hacker got my username/password - it was not something like admin, password.9 months ago my PC was infected with some virus which connected to the FTP server by using password which was saved in CuteFTP and infected all index files with some javascript. Then I changed the user/FTP password and didn't save it anymore in Cute FTP. Of course, I checked all the folders and re-uploaded all infected files. Is it possible that this virus uploaded some hidden file which was able to get the new password for this account?

The server was hacked from so called Tor IP address. I am tiref of worrying about server security and now have an idea to get a static IP address from my ISP and to allow logins only from this IP address. What do you think about it? This idea looks good for me but are there any risks to lose access to the server. Can ISP provider change the static IP address for some reason?

View 9 Replies View Related

Server :: Download Same Sort Of Software That Dell Has Called Open Manage For HP?

Jan 12, 2010

I have an HP proliant ML 350 G4P. I am looking to download same sort of software that dell has called open manage for my HP. I have now idea what HP calls it. I went to the hp site to look up that server and there are a bunch of utilities but its not clear which one i need. I am running CentOS 5.

View 4 Replies View Related

Server :: Synchronizing Server Time With Ntpdate Command In Cron?

Jul 14, 2011

we are synchronizing server time with ntpdate command in cron.how often should it run?

View 3 Replies View Related

Ubuntu Servers :: Cron Sending Email From Address / Change The Default Domain Name For Cron?

Apr 29, 2011

Can anyone tell me how i change the default domain name for cron?everything i cron runs it emails from and to user@com.com

this leaves me with a massive list of failed mails in postfix.i have mailto on my main crontab but i cant do it on all of them.

View 1 Replies View Related

Fedora :: No Output From Cron Jobs In /etc/cron.daily

Jan 29, 2011

I have added some executable scripts to /etc/cron.daily but don't get the stdout/stderr output from them as mail (or anywhere else I have found). At least one of them is running (because I can see that it has added a file to the disk).

The peculiar thing is that I do get the output from /etc/cron.daily/0logwatch (part of the logwatch package) as an email each day.

The MAILTO line in /etc/crontab is "MAILTO=root" (unchanged from default). Same for /etc/anacrontab.

I do have an alias at the end of /etc/aliases which redirects root's mail to my own account, but this alias works fine for mail I send manually. (It also appears to work fine for the output from the file /etc/cron.daily/0logwatch.)

View 3 Replies View Related

Ubuntu Installation :: Cron's /etc/cron.daily/apt Not Upgrading?

Feb 25, 2010

It seems that cron is not upgrading my Ubuntu 8.04 LTS Server, no GUI installed. I changed /etc/crontab and watched apt running:

Code:

ps -A | grep apt

showed it for a long time,

Code:

sudo tcpdump tcp

showed communication with canonical sites,

but:

Code:

top

did not show any apt using CPU

[code].....

View 2 Replies View Related

Ubuntu :: Do Cron Updates Erase Cron Entries

Sep 19, 2010

I put in my cron entries to run my backup script which rsyncs my data to my 2nd drive, however on a hunch I checked my backup drive which mounts automatically via fstab and I realize it had not ran in a while. I checked cron and there were no entries for it. I got to wondering if I should ever be worried about a cron update coming down and over-writing my existing cron file with the backup entries in it to run.

View 2 Replies View Related

CentOS 5 :: Setup A Cron In /var/spool/cron/root

Feb 16, 2010

I have set up a cron in /var/spool/cron/root

*/15 * * * * /usr/bin/phplist.sh

I can see in /var/log/cron that it is running every 15 minutes but it has no effect. It is not doing the commands in the bash script.

If I run /usr/bin/phplist.sh right in the shell it works great.

View 3 Replies View Related

Server :: Cron Is Not Running ?

Jan 31, 2010

I want to make a cron job for my webserver, only it seems not to work...

I have now the followig to test (every 16th minute of the hour, write test to a file), but it doesn't show up. When I write out the cron, it is done to the file: /tmp/crontab.QXsBIO/crontab . How to make cron work? It must be very easy, but I have real troubles getting it fired up.

My Linux version is debian lenny and the cron file looks like (crontab -e):

(with trailing empty line at the end)

View 3 Replies View Related

Server :: Cron Job Not Working?

Jun 1, 2011

I have a cron job to run every 15 minutes. The cron job is running per /var/log/cron. It lists the job every 15 minutes.

[Code]...

I do not see any errors. I also looked in /var/log/messages for any errors and it does not list any. I added a line to the script that is running to send an email to me to see if it is running or not. When I run the script from the command line, the script runs without error and I get an email. I have searched and can not find what it going on. Is there some where else errors might be? Could there be a permission issue? The cron job is not being added by the root user.

View 14 Replies View Related

Server :: Cron Not Running

Jun 15, 2011

Cron on one of my boxes isn't running and I failed to determine why.

Here are what I have found so far:

Password:

View 6 Replies View Related

Server :: Cron Job That Does The Backups?

Mar 21, 2010

I have a crontab related question which I am hoping someone can answer. I recently took over a Redhat Enterprise 5 Server, and I was told by the previous Server Admin that there is a cron job that does the backups. I ran the following command to get a list of all users:

Code:
cat /etc/passwd | grep "/home" |cut -d: -f1

I then ran the following command for each of those users to see if they have any crontabs associated with them:

Code:
crontab -u USER -l

It doesn't show any crontab entries for any users (including root). But I am positive that there is a scheduled job somewhere because the backups are still running every night.

View 6 Replies View Related

Server :: Get Cron Job To Pick Up ~/.my.cnf ?

Sep 2, 2010

My question is how do I get a cron job to pick up the user's ~/.my.cnf? If the user runs the shell script, everything is fine. The cron entry has the same user run the job, and I've tried #!/bin/bash -l in the shell script with no success.

Here are the details:

I have a bash shell script that launches a Python program. The python program issues an external shell mysql -e command.

I don't want the python code to use use -u user-name -pMyPassword, db-name, because this is contained in ~/.my.cnf. The python code doesn't have to use these parameters if run interactively, but does have to if run from cron.

View 2 Replies View Related

Software :: Vixie-Cron Not Running /etc/cron.d/

Feb 9, 2011

Is my vixie-cron broken? i have "0-59 * * * * root /usr/sbin/logrotate /etc/logrotate.conf" but it is not running in /etc/cron.d.

Code:

View 2 Replies View Related

Debian :: PHP Server API - Apache 2 - Cron

Jan 24, 2010

Theres this php script which is to be run every 10 minutes :- php -q /var/www/extra/cron/cron.php

View 3 Replies View Related

Server :: Set A Cron Job To Run Every 7 Minutes Between 7pm And 11pm?

Dec 13, 2010

How would I set a cron job to run every 7 minutes between 7pm and 11pm?

View 4 Replies View Related

Server :: My Cron Job Doesn't Work

Jun 1, 2010

I have a simple cron job that runs every night & I tested this manually by just running the command as root in bash and all worked fine. It took some time but the crob job finished and I got my results emailed to me perfect / as expected.

Here is root's cron job listing:

Code:

Now I noticed that I never ever got anything emailed to me the following day so I am wondering if perhaps the Cron daemon doesn't have permissions or has an issue running / executing the command rather than when I test the command as 'root'? When I view my logs, I can see the command being executed and don't see any errors however I don't get email results when Cron runs the job rather than me taking the command and running it manually in Bash...then it works. What am I missing?

Code:

View 9 Replies View Related

Server :: Using Rsync With Cron On Different Port?

Nov 14, 2010

I'm trying to set-up a cron job that uses rsync to transfer back files from a remote server. ssh on the remote server is running on port 12345 but this seems to be a problem. My script looks like this:

Code:
#!/bin/sh
RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
KEY=/home/username/.ssh/id_rsa.pub

[Code]...

View 6 Replies View Related

Red Hat :: Server Reboots Sometimes Cron.daily

Dec 31, 2008

I have an issue, it doesn't happen every day, I can't seem to trace it down. It happens at 4:02am the cron.daily kicks of at 4AM.. The following is from the /var/log/messages. I receive an panic error then the server shuts down.

View 1 Replies View Related

CentOS 5 Server :: How To See Cron Log File

Mar 15, 2011

I am using cent os 5. I My server daily shutdown at 7:00 PM.I want to see the log file of my cron activity what the process is successfully started or not

View 1 Replies View Related

Networking :: When Called From Cgi Script/apache User: "ldap_bind: Can't Contact LDAP Server (-1)"

Apr 28, 2010

Here are the specs of my machine: Linux matrix 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:12 EDT 2008 i686 i686 i386 GNU/Linux Red Hat Enterprise Linux Server release 5.2 (Tikanga)

When I run an ldapsearch in root, it works fine. tcpdump filtered by dest IP shows packets captured.

When I run an ldapsearch in a perl script as root, it works fine. tcpdump filtered by dest IP shows packets captured.

However, when I run it via a perl script in my cgi-bin directory it fails. tcpdump shows no packets captured. When I added a "2>&1" to my ldap search in my cgi script, I got "ldap_bind: Can't contact LDAP server (-1)".

I ran a "whoami" in my cgi script and it showed up as apache.

Another twist to all this is that I ran the same test on my slackware box, and everything works (esp the cgi script). Here's what the specs are on that machine:

Linux slackvm 2.6.29.6-smp #2 SMP Mon Aug 17 00:52:54 CDT 2009 i686 Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26GHz GenuineIntel GNU/Linux

I checked the permissions on the ldapsearch file and directory, and they're the same (755).

Could there be something blocking the apache user on my Red Hat box from sending packets out?

View 2 Replies View Related

General :: Copy Files From One Server To Other Via Cron Job ?

Apr 21, 2010

OS: zLinux, SuSE Linux Enterprise Server 10

I want to copy files from one server to other servers via cron job.

All servers are part of a network.

Here is the copy command I will use:

This script is in our test server.

We need to copy files to other environment via cron job.

View 12 Replies View Related

Server :: Users Unable To Run Cron Jobs

Jan 6, 2010

I have a file server that is an NIS client. User home directories are auto-mounted from another server. Users are not able to run cron jobs. The /var/log/cron logs says:
Jan 6 14:33:01 inclination crond[3217]: (username) ORPHAN (no passwd entry)

I tried adding an entry in /etc/passwd, /etc/group, and /etc/shadow but the test script I have still doesn't seem to run although cron thinks it did. The log entry for these attempts looks like:
Jan 6 15:30:01 inclination crond[4312]: (username) CMD (/home/username/test-script)

Now root does seem to be able to run cron jobs with no problem. My test script works fine from cron when runs as root. I suspect there's an issue with how I have NIS configured but I can't find any info. The test script runs fine from the command line when logged in as myself.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved