Skip to content
Advertisement

Tag: sh

How to use cron on a simple script

I want to use cron for execute a script periodically. I want to try a simple script first but it does not work. This is my script (scritp.sh) which permission are 700: And this is the crontab file when I edit it with the command crontab -e: EDIT: I have that script on /home/padro/Documents folder. What I do after it

Running variable string match against grep search?

I’ve defined the variables here to shorten the logic a little. The wget works fine (downloads the correct file) and grepping for tar.gz works in the wget.log The issue is the match to another file! Basically, if it’s on a blacklist I want it to skip! Answer Use && to test if both of the grep commands succeed I’ve used

Linux – auto restarting with sleep

Current code of mine is I don’t have access to a linux box right now and only way to do my request will be made on the live server and I don’t want to test and jeopardize something, so I would be happy if I could get some help Is this the way it should be if I want my

What’s the meaning of a ! before a command in the shell?

What is the purpose of a shell command (part of a shell script) starting with an exclamation mark? Concrete example: In foo.sh: I know that without the space the exclamation mark is used for history replacements and ! <expression> according to the man page can be used to evaluate “True if expr is false”. But in the example context that

Including a date/time in a file name dumped from psql

I’m planning on running a .sh script that will run periodically through cron on linux. I’m running postgres 8.4 on centos. My script will have something like this in it: I know there are other ways to dump tables into csv files but this is the only one I could use without admin rights. My problem is naming the files.

Collect and sum statistics of `strace` commands?

I know that I can runstrace -c ls to collect system call statistics on the ls executable. However, I want to run the command strace -c {some executable here} mulitiple times over different executables, merge the individual results, and then write to a single file. I want to merge the ‘syscall’ and the ‘calls’ columns. So for example, if ls

Advertisement