0
votes
0answers
18 views

How to run an script using cron in Windows 7 using cygwin?

I have installed all the dependencies in cron. My scripts are working properly, and also I have tested cron which I think works properly as well. However, I would like to set up a task to run a script ...
0
votes
0answers
29 views

cron job monitoring script

greeting of the day!!! please help me a situation, i am trying to develop a script which provides me details which my cron job is commented or stopped which job is running or scheduled. like we ...
0
votes
0answers
20 views

Make a script identify DBUS session address and use it

I'm using cron with notify-send to display some notifications, but it requires DBUS session to run Here is the script: export DBUS_SESSION_BUS_ADDRESS=[session] #!/bin/sh { DISPLAY=:0 ...
0
votes
1answer
48 views

WGET/cron downloading webcamera file

our new town doctor put a web camera to his waiting room for people to see how much crowded it is. As my mom and grandparents go to this doctor, I wanted to download the files periodically and if they ...
-1
votes
2answers
27 views

What is the risk when editing crontab file without the “crontab -e” command?

I developed a script in which I add lines to the crontab file with echo command and I remove lines with sed command. I do not know the risk of that especially that I find in some web site that we ...
0
votes
0answers
23 views

Warning: the connection is closed, while running cron job

I have found on the Internet simple script to download wallpaper from bing and set it. #!/bin/bash # export DBUS_SESSION_BUS_ADDRESS environment variable useful when the script is set as a cron job ...
0
votes
1answer
34 views

Use of crontab, kill and trap

I'm learning crontab command, and I'm doing some tries. I edited the default crontab file with the command crontab -e, and I want to put a line that every minute send a SIGUSR1 to the current shell ...
1
vote
1answer
91 views

How can I run a Cygwin command (not a Windows native command) as privileged?

If I open a (elevated via UAC) Bash Shell in CygWin: Luis@Kenobi /cygdrive/c/Windows/system32 $ crontab.exe -l -u Luisito must be privileged to use -u Tested on WinXP-SP3 and Win7-SP1. Same results ...
0
votes
3answers
855 views

Why does this script fail when run from cron, but works when run manually?

I have a relatively simple bash script that works great when invoked directly, but fails when run by cron. Why does this fail and how can I make it work via cron? #!/bin/bash apt-get update -y ...
1
vote
1answer
35 views

What permissions do I need to give my user to run “shutdown -r 5” command from cron?

I’m have a bash script that I run in /etc/crontab on Linux $ uname -a Linux mymachine.com 3.4.76-65.111.amzn1.x86_64 #1 SMP Tue Jan 14 21:06:49 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux The bash ...
1
vote
0answers
51 views

Cron deamon written in shell

I'm looking for a script in bash or ksh, that would do ... more or less ... the same as crond. The situation is, that our system administrator suddenly denied the use of crontab to all regular users ...
0
votes
1answer
152 views

Why does this bash script give an error on Ubuntu but not OSX

#!/usr/bin/env sh export $NODE_CONFIG_DIR=/Users/full/path/to/script/config cd /Users/full/path/to/script /usr/local/bin/node main The script runs locally on OSX (if I adjust the paths for the local ...
3
votes
2answers
519 views

Shell script running from cron not running python

I have python program, I want to run it everyday with different variable (on CentOS server): #!/bin/sh /usr/bin/python /root/testing/test.py --variables /root/testing/daily/test1.txt while [ $? != 0 ...
0
votes
1answer
177 views

crontab a bash script that is copying certain files

First I would like to say that I am terrible with scripting so this has been a true challenge for me. Any input would be great! I would like to automate an sftp transfer every 24h. If I am lucky in ...
0
votes
1answer
201 views

How to configure in crontab with condition statement for checks

We like to monitor the NAS storage mounted on a Linux box. We only like to be notified via mail when the usage exceeds a certain number, say 80. We have only seen in Linux books where most of them ...
1
vote
0answers
72 views

Ncat throws errors while being run from crontab

I have a simple script set up on my OpenWrt box to check if one of the computers in a local network is streaming, and if it does, the script starts wget | madplay to play the stream. Script works ...
3
votes
1answer
3k views

BASH - merge directories when using mv

I just started using BASH, so I can move all contents of a directory to another. But the issue is, I was expecting it to merge the directories. I am using cron job to run this script. #!/bin/bash ...
0
votes
2answers
208 views

Script for CRON (FTP get files EVERY MINUTE)

I want to create a script that must run with a CRON every minute (Q: Is it wise to run CRON FTP/wget every minute?) compares local directory with remote directory (Q: do I use FTP or wget and how ...
0
votes
3answers
493 views

Linux crontab script to “mysqldump | gzip” gives wrong filesize

I have a bin/bash script that mysqldumps my sql database, when I run it everything goes well with filesize=3MB, but when crontab(as sudo) runs the script then the filesize is 20B script #!/bin/bash ...
0
votes
1answer
241 views

Cron fails the script command

I am trying to capture a picture with my webcam and I need to log the output to check for errors, but cron is failing at this. I am able to do this from terminal, but cron running it doesn't work. ...
0
votes
3answers
703 views

How to schedule/unschedule cron job from shell

I have a ubuntu server where I put my application core. It's a jar that needs to be always listening for requests. I made a script to run it with the correct parameters. The scenario is similar to ...
1
vote
2answers
2k views

How to auto commit to my git repository using cron?

I look into a lot of answers about this subject, but something is wrong here, let me explain. I create this script, to make my cron cleaner :) #!/bin/bash cd ...
0
votes
3answers
174 views

Automatically Create text file of folder contents

I have a set of directories that have files in them for use with LiquidSoap for use with IceCast2 Currently, every time I remove a file or add a file, I have to edit the txt file listing the mp3s to ...
-2
votes
1answer
322 views

changing ownership of files within a bash script

I have this bash script which outputs the first two files as owned by user, and the next three as owned by root: ################################################## # Variables NUM="6" #number of ...
0
votes
1answer
858 views

ntpdate command not found [only when using with cron]

I have a linux machine with ntpdate installed and it is working when i run it from my ssh terminal or from a shell script manually. However , when i add the shell script to crontab i get the error ...
3
votes
2answers
115 views

Found a script on my cron.monthly, i am wondering what's it doing?

I am new to bash-programming, sorry if this might be a kind of stupid question. I found a script on my server and i am trying to understand every line: #!/bin/sh # # man-db cron weekly set -e if ! ...
1
vote
1answer
130 views

Why echo $(crontab -l) outputs current working directory listing and only then the content of crontab file itself?

So if cwd is the /tmp now: crontab -l > #min hour day mon dow command > * * * * * /usr/local/bin/growlnotify -t 'helloTitle' -m 'helloMessage' -n 'myApp' -sw but: echo $(crontab -l) > ...
3
votes
1answer
335 views

Raspberry Pi: open browser using bash and crontab

I'm trying to setup a simple bash script. I want to open the browser. chromium-browser <url> works if I do it in the cli or in the bash script if I run the script by ./scrpt. But if I put ...
0
votes
3answers
1k views

How to run a script at boot time for normal user?

I want to run a bash script at boot time in CentOS 6. I added the script in /etc/init.d/ directory but all these script are run by root. I want to run script for any user.
1
vote
1answer
586 views

git push to github via cron on mac

I'm trying to use git push in a bash script being run by crontab to push a commit to github. At the end of the script I'm doing this: # script processes some files, then: git add -A git commit -a -m ...
0
votes
1answer
140 views

How do I run a shell script with export command in crontab?

I have a shell script that exports values of variables when executed. The same values will be used in another script. #!/bin/sh export I="10" echo $I I will be using root access for cron. I ...
0
votes
3answers
2k views

“/usr/bin/env bash” is not found when running from a cron script

I have this in my crontab: PATH=/usr/bin:/usr/local/bin:$PATH */1 * * * * /usr/bin/env bash > ~/cron.log 2>&1 The ouput in cron.log is the following: /usr/bin/env bash: No such file or ...
2
votes
1answer
824 views

Nice commands in a .sh script for cron jobs

I have this php script that I need to run on shared webhosting. I have created a cron job that executes an sh script. The command for the cron was: /bin/sh /home/user/script.sh So I'm assuming it is ...
1
vote
1answer
72 views

Script acts differently whe run by cron

I have a script that runs nightly, that is returning different results than when I run it manually. I realise that this is a common question and my problem most likely lies in an environment variable ...
0
votes
1answer
178 views

Cronjob does not work

I tried to set up a cronjob on my server. Actually this command should execute a java programm every hour. But somehow this didn't worked. I googled and tried to set up a test-script that should run ...
0
votes
1answer
124 views

Cronjob using the mail function

When I run this mail command from the terminal, there's no problems: mail -s "Test Mail" user@example.com < home/user/example.txt When I add it to a bash script that mainly does this, there's no ...
2
votes
1answer
2k views

Two parts: linux startup script to connect to bluetooth and cron to keep it connected

I have a mini bluetooth keyboard and a Raspberry Pi running a Debian-based distro. I know the MAC address of the keyboard but for this question, let's just use AA:BB:CC:DD:EE:FF. Right now I have to ...
0
votes
0answers
141 views

Will my weekly cron job work?

I'm just getting back into bash scripting and I want my cron job to run every 15 minutes between 9.15 and 10 PM. I've checked the script works, but I don't know if it's the right command: ...
3
votes
2answers
3k views

ssh Permission denied only in cron job

Having a very strange problem. I've created a small bash script which runs a command on a remote host via ssh (using public key authentication). When I run this script manually from the command line ...
0
votes
1answer
334 views

Cron job for moving directories older than 24 hours

Well, what I want to do is The cron should run every hour or so It should move the directories in a folder /disk1/data/ older than 24 hours to /disk2/data/ The directories moved should contain all ...
0
votes
1answer
2k views

How to delete directories older than one hour (cron job)

My application creates directories when user performs certain action. These directories are stored on my machine for exactly one hour and than are deleted. Now I would like to move the 'deleting ...
1
vote
2answers
2k views

Cron environment variables

I'm running a simple shell script that runs just fine in a login shell from cron, where it doesn't run. For some reason, /usr/local/bin is not on the users path when run from cron while it is when run ...
1
vote
1answer
450 views

Jobs with anacron won't run

I would like to run two bash scripts daily using anacron in order to backup some data. Unfortunately I can't figure out why said scripts are not executed. For test purposes I let cron execute the ...
0
votes
2answers
1k views

Open a terminal from a Crontab

How do I get a gnome-terminal window to open from a crontab? I have tried this: * * * * * /usr/bin/gnome-terminal * * * * * source /home/user_name/.bashrc ; /usr/bin/gnome-terminal * ...
1
vote
0answers
98 views

script -e and crontab or at

I have a shellscript I want to run via at and use script to capture a transcript. script -e was introduced in util-linux-ng 2.18 and returns the retval of the child process. I want to capture the ...
2
votes
2answers
7k views

How to create folders according to date in Linux?

Is there any other short/easier and smarter way to do the following in Linux? cd /home/abcd/dammi mkdir $(date +%Y-%m) cd $(date +%Y-%m) mkdir $(date +%d) # RESULT : /home/abcd/dammi/2011-05/26 cd ...
0
votes
2answers
244 views

How do can I update a Form using shell/bash script on Linux?

I am wondering is it possible to echo values like below described? The situation is - there are too many "doc" files named like "PLCI507_01234567.doc", and there is a Form in a text file named ...
1
vote
1answer
3k views

Chrome browser full Kiosk mode in Linux (Puppy Linux)

Let me just say thanks in advance. I am having issues getting google-chrome browser into full KIOSK MODE with no browser bar on a linux platform Looking through the google forums I have found ...
1
vote
1answer
314 views

Telnet fails to run properly when run from daemon process

When I call telnet to connect to daytime server from interactive shell, it works fine. However, when the same telnet call is issued from a shell script run by cron or some bash daemon process, it ...
0
votes
2answers
947 views

RHEL6 Crontab doesn't work properly?

In RHEL6 root's account I have crontab job: 30 6 18 4 1 /sbin/init 6 It worked fine on the 18th of April and properly restarted my system, BUT it also restarted my OS at 6:30 on next Monday - ...