Cron As Postgres User Not Working
I was hoping someone could shed some light on a cron related issue I'm having.
I've been using linux for a while...but never really used crons.
My cron is supposed to dump a postgres db in tar.gz format every minute (for testing purposes) but it doesn't.
I opened my cron in vim via:
Code:
postgres@myhost:~$ crontab -e
And here's the cron:
Code:
* * * * * /usr/bin/pg_dump -D warranty_1_6_test | gzip -c > /var/www/test/postgres/backup$(date +"%Y%m%d_%H%M").tar.gz
Also:
Code:
postgres@myhost:~$ ls -lah /var/www/test/postgres/
total 8.0K
drwxrwxrwx 2 postgres postgres 4.0K 2007-06-14 12:01 .
drwxr-xr-x 3 user user 4.0K 2007-06-14 11:47 ..
Running the backup command via CLI works fine.
View Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
Cron Quit Working...
I have a dedicated CentOS 4.5 Server. However, as you can probably guess I am new to linux and managing a server... Anyway, beginning of this month my crons quit working, I still receive emails as if they are ran but I can't get the scripts to actually execute. I have not touched the crontabs or anything prior to them not working, they simply quit working... I did not notice immediatly they did not work, I am guessing that it was around the time of which I rebuilt apache to a new version of PHP. Today I tried changing them to "php path/to/script.php" and I also tried "path/to/php /path/to/script.php", neither worked. Any ideas or suggestions as to how I can fix this?
View Replies!
View Related
Logrotate Cron Not Working
I recently purchased a new dedicated server, since I have had this server (8 days) I have being receiving the following email: Quote: /etc/cron.daily/logrotate: error: error accessing /var/log/httpd: No such file or directory error: httpd:1 glob failed for /var/log/httpd/*log
View Replies!
View Related
Cron - Not Working - Apache
I did not realize the significance of the Apache sub-forum. I thought perhaps this would be a more general Server management query, but I realize now I should have posted in Apache forum. I have been banging my head against the wall for the last couple of days trying to get cron jobs working. It's actually making me quite depressed, a lot of people are waiting on me to get this working, and for the life of me I see no light. I'm not a stupid person, i'm a PHP developer, and have some linux skills. This is the single most annoying issue I have had to deal with simply because I cannot find any troubleshooting methods to my issue. I have tried every different combination of command under the sun and I cannot get any sign that the cron is running the commands. I own a "virtual" dedicated server with a hosting company, I have full root access. Linux / Apache The script file is a PHP file which simply mail() an email saying that cron is working, I am yet to receive this mail that was executed by cron. I have ensured there are no errors in this simple PHP file, I have executed the script from the shell and all is well there.. So, firstly I tried to setup the cron table from CPanel, on the account where the script resides. I used the following command combinations: Code: 0-59 * * * * /usr/local/bin/php /home/username/public_html/cron.php 0-59 * * * * php -q /home/username/public_html/cron.php 0-59 * * * * php /home/username/public_html/cron.php 0-59 * * * * cd "/home/username/public_html/"; php cron.php 0-59 * * * * wget [url] with time combinations of: * * * * * to get the command to be executed evey minute, for testing purposes. All these commands work fine when executed through the shell. I set the mail address for cron output to be my mail address also. I do not get any mail from cpanel with an overview of the cron executions. I then gave up trying to get cron to work on that account, and decided to go root. I logged into the shell via root, checked the cron table for root. I edited the root cron table (that contains commands for various cpanel scripts etc) to include a command to execute the php script, even with the script residing on the root directory. I also added MAILTO="myemail@email.com" to the first line of the cron table. I do not get any emails of the cron actions. How can I check if the cron scheduler is working when I get no sign that the cron commands are being executed, and when I do not receive any cron emails? What methods are there for me to troubleshoot this issue? Could it be possible that cron shedular is not active on my server? I have lurked the net with great detail to find any method to troubleshoot my issue, and all the related pages I find are to do with troubleshooting the commands. I know my commands are fine, there is some other issue here.
View Replies!
View Related
Cron Job Not Working Properly
I have a slight problem with a cron job I have setup. I wanted to save a copy of iptables every hour to a folder, so I created a script... here it is: Code: varDate=`date +%y%m%d` varTime=`date +%H%M` filename="IPtablesBackup-$varDate-$varTime" iptables-save -c > /etc/IPtablesBackup/$filename and called is Backup-Script.sh Now if I just execute the script will in root ./Backup-Script.sh I get a new file with the correct filename and iptables info is saved ! Great ! So then I thought, how can I setup this automatically every hour. Which leads me on to my problem. I inputted "crontab -e" added this line Code: 59 * * * * /etc/IPtablesBackup/Backup-Script.sh The problem is the script is run, I know because it creates a new file with the correct time and date, however the file is empty? I have set Backup-Script.sh to 777 and owner and group are both root?
View Replies!
View Related
Cron Working But Command Isn't ?
I'm needing some info i have been pulling my hair out for hours trying to get some cronjobs lined up i started out with knowing nothing about it and i'm a little better off now i got the cron running but the commands aren't executing so maybe someone can help me figure out why i would greatly appreciate it Here's The deal I telnetted in set the following crontab ...
View Replies!
View Related
Cron Job Not Working, Restart Services
I'm having a bit of trouble with one cron job that doesn't seem to work. I have others scripts that run hourly fine. However this one does not. The script: restart_monitoring.sh Code: #!/bin/bash service iptables stop service iptables start /root/bandwidth_rules.sh /root/portforward_config.sh exit The two scripts at the end just load a lot of iptables rules back in. The cron job should run hourly (59th minute) The cron job entry Code: 59 * * * * /root/restart_monitoring.sh I have restart crond to enable the new job, still doesn't run. The job is to restart iptables, thus flushing all rules that I have running, then reloading them. I have figured out the problem to be with the "service iptables stop/start" command, it doesn't seem to like doing this...?
View Replies!
View Related
Disk Quota Not Working For User Accounts
I am having Virtuozzo vps with cpanel/WHM installed.I have created some accounts in it by setting disk quota . Now the issue is : some users are using space over the allocted one ,when i use the command quota -u (username),i can see that the users are used the space over the allocated one and they are still allowed to upload file . How to fix this issue ?
View Replies!
View Related
Weird MySQL: User/pass Stops Working After A While
I am having a very strange problem with 2 different cPanel accounts on a server with 500-600 accounts. For some reason after a day or two the mysql username/password stops working. We have tried changing the MySQL user and the password with no success. The log does not indicate that the MySQL password was changed in any way. Only these 2 accounts are affected and this problem occurred at least half dozen times each. Again: these are two different accounts with 2 different MySQL users that after a while stop working (I am unable to determine if they stop working at the same time b/c they belong to different customers). When we reset the user (with the same pass) it works for a day or two. I have checked to connect not only from PHP but also from shell when it's down: it also doesn't work so this is a pure MySQL problem. Also on the server we have Fantastico.
View Replies!
View Related
Postgres Install
I have a server running Cpanel and I have added postgres through /scripts/installpostgres, also I have set it over WHM and can access phppgadmin but I got this error when connecting throug a script Fatal error: Call to undefined function: pg_connect() in /home/rer1223/public_html/process/Connection.php on line 4 I checked and postgres is not listed in phpinfo output.
View Replies!
View Related
Cannot Add Postgres Database
PostgreSQL (Cannot add new user or database). It will return "User/DB added successfully" but no new user or database is added. root@server [~]# rpm -qa | grep postgre postgresql-devel-8.1.4-3PGDG postgresql-contrib-8.1.4-3PGDG postgresql-8.1.4-3PGDG postgresql-server-8.1.4-3PGDG postgresql-libs-8.1.4-3PGDG postgresql-python-8.1.4-3PGDG I've already compiled apache after postgres was upgraded months ago. I'm using cpanel 10x
View Replies!
View Related
Postgres: Restoring A Filesystem Backup
i had to do a file system back up because of the size of my database. i shutdown postmaster and tar'd the files. i recently reloaded my OS and now i'm attempting to restore the backups. i first shut down postmaster, restored the backups to the data folder and restarted postmaster. i then su'd from root to postgres user: Code: [postgres@austin1 pgsql]$ psql service_2_3 psql: FATAL: database "service_2_3" does not exist DETAIL: The database subdirectory "base/16385" is missing. the backups had a database named service_2_3 but upon restoring the backups, it doesn't seem to be available. my data directory is /var/pgsql/data. Code: [postgres@austin1 pgsql]$ ls -lahR /var/pgsql/ | grep 16385 but that yielded nothing. have i done something wrong while backing up? i don't think i have since i followed the postgres manual when backing up. but the administrators have not been very thorough with how they've set the system up for me. how i can resolve this issue if you have the time.
View Replies!
View Related
Restoring 1.5GB SQL Dump (Postgres)
This seemed like the most appropriate place so I decided to post here. SYSTEM: Fedora Core 4, 3GHz, 2GB RAM Postgres 8, Apache 2, PHP 4 The issue is that I have with me a 1.5GB SQL dump from Postgres 8 which I extracted using pg_dump. Restoring it seems to be an issue on this PC. I've tried modifying memory directives in postgresql.conf as well as the kernels SHMAX value but no go. I tried a bunch of other things such as gzipping the file so that it was only 100mb and doing: Code: gunzip -c dump.sql.gz | psql my_db But I recieved many errors saying "invalid command N" and I also got a syntax error notice and the process terminated. I tried to at least try and enter some data manually but vim is incredibly slow since this is a 1.5GB file. Is there a way I could perhaps split up my db dump and then import them into the db one by one?
View Replies!
View Related
IDENT Authentication Failed For Postgres. Pg_hba.conf
I just reloaded the OS on our production server and I'm having issues configuring postgres. the user postgres exists in the system (i.e. 'su postgres' switches me to that user) i attempted to connect to my database 'service_2_3' via CLI: Code: $ su postgres $ psql service_2_3 and i recieved the following error: Code: psql: FATAL: IDENT authentication failed for user "postgres@service_2_3" the database is installed on the machine on which i was attempting to connect to it with. therefore, i edited my pg_hba.conf so that it looks like this: Code: # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all ident sameuser # IPv4 local connections: host all all 127.0.0.1/32 ident sameuser # IPv6 local connections: host all all ::1/128 ident sameuser host all all 0.0.0.0 0.0.0.0 password and reloaded with (as user postgres): Code: bash-3.00$ pg_ctl reload -D /var/lib/pgsql/data -l /var/lib/pgsql/data/temp.log but i still get the same error. am i editing the wrong file, perhaps? how would i know which is the correct pg_hba.conf file? locate pg_hba.conf seems to give me a few results.
View Replies!
View Related
Non-working Forwarding Email Account On Working Domain
I have a domain with a few forwarding email accounts that forward to mac.com email accounts... for some reason every once in a while these accounts stop working... This is the error I get when I email to that account: This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: ...
View Replies!
View Related
Cron
I have root access to a server. Is it possible to create a cron that would restart my ftp and http server every so often. Like once a week or somthing. If so how would i do it?
View Replies!
View Related
Per Second Cron Jobs?
Hey everyone, my friend's dad is looking for a web host that will allow his cron jobs to run every second. Most hosts apparently dont allow cron jobs faster than 5 seconds apart. How often a host can run cron jobs isn't really advertised on their sites so I'm having a bit of trouble finding a host. I've resorted to just sending emails to sales addresses asking about it. Does anyone know how I can find a host like this?
View Replies!
View Related
Does Cron Timeout?
Simply wondering, does cron timeout? I have heard mixed reports and can't find any good info. Personally i've run a cronjob for up to 6 minutes, but as my best method was sending myself emails through php, its not exactly a highly accurate testing method. On the same note, what would happen if one cronjob is running a php script for over 10 minutes, then another cron job starts on the same script, before the first one has finished?
View Replies!
View Related
Rsync And Cron
I have a bit of a strange problem, I have an rsync command setup in the servers crontab and from the cron log it show it ran the command but the files don't copy to the backup server. If I take the rsync syntax and run it manually all the files copy across with no errors, but I can't figure out why the cronjob doesn't work properly.
View Replies!
View Related
Remote Cron
I've just noticed that many people may have a free remote cron facility without realising it. If you have any domains registered with Godaddy, you get free web space that includes a cron facility. It only runs every half hour, but you could set six jobs at 5 min intervals to get an effective 5-minute poll, which is good enough for many purposes. You could use it to check uptime on another site, for example. Has anyone tried this?
View Replies!
View Related
Cron Commands
I've been reading through tutorials for setting up cron commands via cPanel, but everything I have tried does not work. What I need to do is simple - I just want to run a php file on my server once every 15 minutes.
View Replies!
View Related
Error In Cron
Got this from the daily.cron email: /etc/cron.daily/chkrootkit.sh: /proc/18927/fd: No such file or directory really weird, when I run that command manually, it doesn't show that error.
View Replies!
View Related
Cron Daemon
Im getting daily 100 of emails from Cron Daemon Cron which having following information any body let me know what is cron daemon and how can i disable these email Code: /bin/sh: /usr/local/etc/logcheck.sh: No such file or directory
View Replies!
View Related
Cron Job
in order to backup db automatically i want to use cron job. So i set cron job at 00 AM suppose that : my infos db name : db db user : zode db pass : 123 the command i use is following PHP Code: mysqldump -u zode -p123 of -K -c -f --compatible=mysql40 --default-character-set=utf8 db > backup/db_`date +%d%m%y`.sql in good time i am looking into backup directory db is in it or not but there is nothing in it
View Replies!
View Related
Cron / WGet
My crontab uses Wget to access a PHP file. It works just fine; however, the only problem is that each time the crontab is run it creates a file in the root of my site called filename.php.10XX filename is the name of the file that Wget runs and 10xx is just the number of times the tab has been run. How can I prevent these files from being created?
View Replies!
View Related
Cron Job
I run A Centos 4.xx latest kernel server and Ive got a problem with Cron Job reporting. The Cron Jobs themselves are working fine but I keep getting this message, on the hour, every hour Quote: Originally Posted by Email from the Cron Daemon Not a directory: /etc/cron.hourly The folder etc/cron.hourly DOES EXIST! and I cannot work out what could be causing this? Does anyone hgave any ideas what could be causing it
View Replies!
View Related
CRON Job Timing Out
i have had a problem for some time now, regarding my CRON jobs. I am trying to download a large amount of data from ebay (through their API, totally legal and aboveboard) using php, but my CRONjob times out. I have tried resetting the timeout variable, but then it exceeds the maximum filesize SO, my question: is there any way to have a script run as a CRON job, and wen it is complete, call another script?
View Replies!
View Related
Reboot Cron Job
VPS isn't rebooting by itself when it goes down. Anyone has any program/script that monitors heartbeat of the server? Like when it goes down, the program will automatically reboots the system. I know there's such a script out there but I forgot what it called.
View Replies!
View Related
How To Cron On Windows Server?
I truly love the 'cron' feature on Linux servers. This way I can schedule php scripts to do repetitive tasks on my website, but I plan to develop a asp.net website. Is this kind of scheduling scripts possible on Windows servers? Else how do I perform repetitive automatic tasks? It would be a shared hosting.
View Replies!
View Related
MRTG Cron Error
I've installed mrtg on my server and it's working fine, but I keep getting the following cronjob error every few minutes: /usr/local/mrtg-2/bin/rateup: /usr/local/lib/libpng12.so.0: no version information available (required by /usr/lib64/libgd.so.2) I've searched the net for a resolution and found others have had this issue, but no resolution has been offered. Anyone else have this problem or know the solution?
View Replies!
View Related
Can Cron (back Ups)
I want to set up a cron job to make daily back-ups of my database, but by turning my site off first. This is how I envisage it to work: 1: rename '.htacess' (in public_html folder for the site) to .htaccess-open 2: rename '.htaccess-closed' to .htaccess // this closes the site down so no-one can write/access the db (they are basically shown a 'site down for maintenance' page - I already have the code for this) 3: mysqldump --opt (DB_NAME) -u (DB_USERNAME) -p(DB_PASSWORD) > /path/to/dbbackup-$(date +%m%d%Y).sql // this backs up the database 4: wait for 3 to finish 5: rename '.htaccess' to .htaccess-closed 6: rename '.htacess-open' to .htaccess // this opens the site back upIs this easy enough to do? Anyone got any tips/pointers?
View Replies!
View Related
Cron Job Email In DA
I've got limited knowledge in scripting so I've come to the interweb for help. Google hasn't answered any of my queries so the trusty WHT is next. I'm trying to create a script cron that will email my clients once per month with space and bandwidth useage reminders. I'd prefer not to have to set up crons in each individual account, but rather email all with tokening including |name| |bandwidth| |space| out of the allowed space & bandwidth according to the clients package.
View Replies!
View Related
How Do I Change The Cron Schedule
We have a Cron executed program which runs at certain times of the day. I need to changes these times. How do I do this? To be exact the program that is executed is called daily_charges.jsp And I have looked under etc/cron.daily and I see no call to this program FYI looking under etc/crontab I see this: SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # run-parts 01 * * * * root run-parts /etc/cron.hourly 02 4 * * * root run-parts /etc/cron.daily 22 4 * * 0 root run-parts /etc/cron.weekly 42 4 1 * * root run-parts /etc/cron.monthly which obviously is the default Linux included Crontab file so this file cannot be the one that runs the daily crons. how can I find where is the Cron code that daily runs the program: daily_charges.jsp
View Replies!
View Related
How To Schedual Cron Jobs
I have a number of PHP scripts that I would like to automatically run daily at midnight. I am currently running a VPS server but have no idea how to achieve this. I do have webmin on my sever but am unsure of what command I need to run.
View Replies!
View Related
Cron Jobs Not Running
I have a machine, that for some reason stopped running it's cron jobs for some reason, and I can figure out how to get them working again. My /etc/crontab file is as follows. SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # run-parts 01 * * * * root run-parts /etc/cron.hourly 02 4 * * * root run-parts /etc/cron.daily 22 4 * * 0 root run-parts /etc/cron.weekly 42 4 1 * * root run-parts /etc/cron.monthly Here are the contents of a sample user cron file. MAILTO="USER" 10 4 * * * php -q -f /home/USER/public_html/tools/updtransfers.php /home/USER/public_html >/dev/null 2>&1 10 5 * * * php -q -f /home/USER/public_html/tools/updateexp.php /home/USER/public_html >/dev/null 2>&1 10 5 * * * php -q -f /home/USER/public_html/tools/invoice_cron.php /home/USER/public_html >/dev/null 2>&1 and another */5 * * * * /usr/local/bin/php -c /home/USER/php.ini /home/USER/public_html/poller.php > /dev/null 2>&1 I've checked my logs, and I can find no errors anywhere. When I run the commands manually via SSH, they work perfectly, they simply are not being run automatically the way they are supposed to be. I have checked, and the crond service is running. I have tried restarting it, but it seams to have no affect. I really have no idea what the issue is. The only thing I seam to have found at one point, was the possibility that the files within the /etc/cron.d directory might be CHMOD'ed wrong, but I haven't found anything to confirm this either way. [root@server cron.d]# ls -all total 60 drwxr-xr-x 2 root root 4096 Dec 17 03:07 . drwx--x--x 94 root root 12288 Jan 3 09:28 .. -rw-r--r-- 1 root root 61 Jun 22 2007 csf_update -rw-r--r-- 1 root root 81 Apr 11 2007 lsm -rw-r--r-- 1 root root 79 Jun 22 2007 prm -rw------- 1 root root 366 Feb 23 2007 sa-update -rw-r--r-- 1 root root 82 Jun 22 2007 spri -rw-r--r-- 1 root root 188 Nov 16 23:14 sysstat [root@server cron.d]#
View Replies!
View Related
How Can I Backup CPanel With Cron
I just went through a week of nightmares, because my host lost hard drives and stuff.. lost my data, etc.. what ever.. I want to work out how I can cron cPanel backups. I did a search online for a cPanel backup manager, but I didn't have much luck. Or, maybe there's some other way to get regular backups? I don't really need to backup my whole sites. I keep my files locally, but of course I don't have the databases locally -- or the email records. All I "really" need is the database SQL files, so that I can rebuild my forums if need be, and also the email setup files -- because I have over 50 domains and I have emails set up on all of them. I want to have them emailed to myself. There's an option in cPanel too, which allows me to "generate/download a full backup".. well, how do I "restore" the backup? ie: I know how to backup and restore the home directory, databases and email stuff (there's 3 options in cPanel), but there doesn't seem to be anywhere to restore the full backup. Anyway, can anyone give me advice on how to keep backups of my cPanel accounts? I don't trust hosts anymore. They say they back stuff up, but they never to.
View Replies!
View Related
Cron Demon Error
I have got this email after a bit of tweaking of my server with this message for the last 6 hours at 2 hour intervals. /etc/cron.hourly/modsecparse.pl: install_driver(mysql) failed: Can't load '/usr/lib/perl5/site_perl/5.8.8/i686-linux/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.14: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.8/i686-linux/XSLoader.pm line 70. at /usr/lib/perl5/site_perl/5.8.8/i686-linux/DBD/mysql.pm line 14 Compilation failed in require at (eval 4) line 3. Perhaps a required shared library or dll isn't installed where expected at /etc/cron.hourly/modsecparse.pl line 19
View Replies!
View Related
MySQLDUMP Cron Job
setting up a new cron job. I would like to have MySQLDUMP dump my specified database(s) into a specified folder using date and time stamps in the filename. I've done some searching on this but haven't really came up with a way to do all of this at once, or if I may need to setup a cron job to rename the file after the dump has completed. I may be going about this all wrong to begin with, I'm just looking for a very simple and reliable way to backup my databases. I'm testing this on a Shared Web Host account at this time which does have SSH shell access, but I wasn't sure if this makes a difference.
View Replies!
View Related
Alternative To CRON As A Script
My webshosts don't offer CRONJOB's as standard. If I want to add it my hosting goes from £19.99 per annum to £89.99 would you believe! Is there another way I can run scheduled jobs? Is there a PHP-script someone knows about? Increasing my costs by 75% a year isn't feasable...
View Replies!
View Related
Setting Up A Cron In SSH
I am trying to setup a cron in SSH to use Ipanel with forced ads for a new free service im providing soon, I have tried but cant seem to figure out how i do it, im totally new to crons in SSH so i havent got a clue
View Replies!
View Related
Cron Jobs Failing
I have jobs that fail every now and then. I get this email: Looking up www.xxxx.com www.xxxx.com Making HTTP connection to www.xxxx.com Sending HTTP request. HTTP request sent; waiting for response. Alert!: Unexpected network read error; connection aborted. Can't Access [url] Alert!: Unable to access document. lynx: Can't access startfile
View Replies!
View Related
|