Tag Info

New answers tagged

4

How about looking in the crontabs spool directory? On my machine (CentOS 6), that's /var/spool/cron: [me@lory ~]$ sudo ls -al /var/spool/cron/ total 56 drwx------. 2 root root 4096 Nov 23 2013 . drwxr-xr-x. 17 root root 4096 Aug 16 2012 .. -rw-------. 1 root root 252 Oct 2 2008 carol -rw-------. 1 root root 504 Sep 22 2006 ...


0

Also you can do by this 0 0-23/2 * * * /path/to/the/script or if you want to be more specific on every 2 hours, you can use 0 0,2,4,6,8,10,12,14,16,18,20,22 * * * /path/to/the/script The hours values should be sparated by commas.


0

The server runs stunnel so the FTP connection is initiated through a port on the localhost (127.0.0.1) I doubt this will work. FTP needs a control connection which you might tunnel through stunnel. But additionally to this it needs data connections for each data transfer (STOR, RETR, LIST...). Do you really use the same setup on the working command ...


0

Recent versions of cron allow you to set arbitrary environment variables before running jobs. So you could add this to your crontab: CRON=1 Then in your .bash_login do something like this: [ -n "$CRON" ] && . .bashrc


1

I think adding -t to your argument list will help. To verify this you could add --itemize-changes to the arguments (without -t). If I understood you correctly, this would show the T-flag in every line man 1 rspec: A t means the modification time is different and is being updated to the sender’s value (requires --times). An alternate value of T ...


0

No, it seems that variables in a crontab in my RHEL 6 at least are not parsed as a shell script would be, a simple test scenario with a crontab like this: NOW=$(date) * * * * * echo $NOW >> /tmp/logfile results in a logfile full of literal $(date) lines I would suggest each script maintaining it's own output files instead of redirecting stdout from ...


1

Can I fix this at a system level, or is this something going wrong with each individual process? It is difficult to say because its unknown what is happening at the protocol level. Basically the read(2) will block indefinitely providing:- The TCP connection remains open. You expect at least 1 byte of data to arrive. The sender is not ready to send you ...


3

By default rsync will read the entire file on both source and destination, to verify that they are identical. This does not consume network bandwidth, as it will only be comparing a hash value. But it does spend time reading from the disk. In one usage scenario, I found this to be terribly inefficient because the source files were only being appended to. I ...


1

why do you say it takes longer each time? how is that possible? maybe it's the program generating the files that is touching them? try with --checksum: skip based on checksum, not mod-time & size, see if that changes anything (i wouldn't keep this option because it reads every file from the disk every time, too expensive, i'm only suggesting it to find ...


1

From your symptom, sync attempts were most likely unfinished due to slow link and the additional sync killing afterwards. In that case --inplace option is actually the worst option since it is not designed for network-bound situations. Quoting from the --inplace option: WARNING: The file’s data will be in an inconsistent state during the transfer (and ...


0

According to the not accepted answers to a similar question it depends on which version of cron you're running. Check man 5 crontab if setting the CONTENT_TYPE and/or CONTENT_TRANSFER_ENCODING variables is supported to change from the default plain text. AFAIK in cronie on RHEL 6 it is and if the output from script is HTML formatted the following should ...


0

I built a simple tool for this type of monitoring - https://cronitor.io It allows you to set both intervals (every 24 hours) and durations (greater than 10 minutes, less than 2 minutes, etc), and then receive email/SMS alerts if your cron job (or any other automated task) doesn't run according to the rules you defined. The tool is free for individual ...


1

Your first example sends both stderr and stdout to the file (2>&1) ; the MAILTO variable set in the cron will capture any output that is not redirected, and this combined with directing the output to the file means that no output is available for the cron to email. I'd suggest using tee to append the output to the file as well as sending it to stdout; ...


2

I posted a similar answer to a question on StackOverflow(http://stackoverflow.com/questions/21025495/system-for-monitoring-cron-jobs-and-automated-tasks) Cronitor (https://cronitor.io) was a tool I built exactly for this purpose. It basically boils down to being a tracking beacon that uses http requests as the pings. However, one of the needs that the OP ...


2

Adding --inplace will help with big files greatly. It makes picking up after a failed or killed rsync faster because it doesn't use temporary files.


2

Use Flock(1): NAME flock - manage locks from shell scripts SYNOPSIS flock [options] <file> -c <command> flock [options] <directory> -c <command> flock [options] <file descriptor number> [...] You can have it block or immediately exit. The existence of the lock file doesn't make a difference -- it ...


0

It is not always "enough" to restart crond. set /etc/localtime as symlink to link with one of /usr/share/zoneinfo/... time zone file set /etc/sysconfig/clock to ZONE="CONTINENT/TOWN" (+ UTC=true and ARC=false) restart the whole machine


1

You didn't mention on which OS those websites run, but I'll assume Linux because you mentioned cron jobs; in this case, I'd recommend PERL or Python, which fully support running SQL queries and are really easy to run as shell scripts, and thus as cron jobs. I'd avoid PHP, as getting it to run from a shell script can get somewhat more tricky, but it's your ...


2

I added the --ignore-existing command and it looks like it won't change anything and only download new files. rsync -vzr --ignore-existing -e Edit: When there are new files it still takes longer each cycle.


0

Did your machine perhaps restart right around then? Based on your log it seems that cron got restarted at least. It's possible you have a bad CMOS battery, and your machine isn't keeping accurate time when powered off. Is this a virtual machine? Perhaps it was migrated to a different host, and the clock became incorrect during the migration? Does your ...


2

Don't use the -v option of rsync, instead use --out-format: rsync --out-format="%n%L" -az user@r18:~/assets ~/18 >> ~/18/rsync.log 2>&1 Will only have output when you are transfering files, and no output when you don't. To have more fancy output look at the rsync.conf man page, in the "log format" section.


1

So what happens if I upload a file/archive, then later, the file changes locally, and the next time I do a backup, how does Glacier deal with this since it can't overwrite the file with a new version? Per the Glacier FAQ: You store data in Amazon Glacier as an archive. Each archive is assigned a unique archive ID that can later be used to retrieve ...



Top 50 recent answers are included