Tag Info

Hot answers tagged

4

I have to deal with this on occasion with some legacy systems. Sometimes the files retained in the organization's source control (Borland Starteam) were set to the wrong linefeed configuration. But working in a number of cross-platform environments, copy/paste should not cause this issue alone. Try to identify the trends based on the output from the ...


4

Someone has already written a script that does this, and it has a lot of great features, plus it has been tested by many people for years. It is called "rsnapshot". I highly recommend "rsnapshot". It is easy to configure and will do a 3-day retention, or even more complex retention policies. http://www.rsnapshot.org/


3

I think that instead of adding @reboot wwwuser ... to /var/spool/cron/crontabs/username, you should run crontab -e as user wwwuser and add: @reboot ./run.sh >>~/tracefile 2>&1 Just in case make sure to use the full path to the script. In case you're making these changes programmatically, you could try the following: #write out current ...


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

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 ...


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.


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.


2

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 ...


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.


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 ...


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; ...


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 ...


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 ...


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 ...


1

Put /etc/cron.d/atop back to 0 0 * * * root /etc/rc.d/init.d/atop condrestart > /dev/null 2>&1 || : Run chkconfig atop on service atop start


1

This is the environment issue , we need to set the env path in cron as below 38 03 * * 5 /bin/ksh c ". /home/adcis/caliber/.profile ; /home/xyz/abc/ABCD_BATCH/REPORT_ABC/amb_main_script.ksh" >> /home/xyz/abc/ABCD_BATCH/LOGS/output.txt


1

Specify the full path to curl in your crontab - your shell knows where to find it because there's a $PATH environment variable available, but there's no such beast in the cron environment.


1

You can't do this cron isn't that smart as you mention you will need 3 lines #Mon * 1-23 * * 1 task #Tue to Sat * * * * 2-6 task # Sun * 1 * * 0 task or something similar.



Only top voted, non community-wiki answers of a minimum length are eligible