Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-29-2015, 09:57 AM   #46
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,521

Rep: Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106

How did you modify the PATH, and in what file?
Old 05-29-2015, 02:44 PM   #47
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 355

Rep: Reputation: 152Reputation: 152
Originally Posted by tearsforhari View Post
Suicidaleggroll, anyone?

I wrote the above script called "" and put it in a directory with path /home/scripts/ It works just fine. I then set several similar cronjobs, which also work just fine. But I nevertheless get an error mailed as root:
/home/scripts/ 13: /home/scripts/ [[: not found
/home/scripts/ 23: /home/scripts/ [[: not found
/home/scripts/ 33: /home/scripts/ [[: not found
I am wondering if this has something to do with needing to add /home/scripts to the PATH of the root user. But I don't understand why it is mailing this error when it actually worked?
From the error message, it looks like the shell interpreter does not understand the [[ syntax. When you run a script from cron, it may use another shell instead of bash. Put the following line first in your script, to force it to use bash:
The blocks are not working as expected (they are doing something, but not what you intended), but the sshfs, rsync, and umount commands appear to be working fine.

Last edited by Beryllos; 05-29-2015 at 02:51 PM. Reason: last paragraph explaining why the backup is working
Old 05-30-2015, 12:32 AM   #48
Registered: Mar 2015
Posts: 79

Original Poster
Rep: Reputation: Disabled
I thought I had to add the PATH /home/scripts to some .bashrc file. But I am first trying Beryllos' suggestion, which makes sense.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] rsync between two different servers astalavista2000 Linux - Server 7 12-13-2010 09:10 PM
how to rsync files on two servers that have two different file systems mrotsliah Linux - General 2 08-11-2010 03:29 PM
rsync can not rsync files with include filter... xiutuo Linux - Server 2 07-23-2010 02:10 AM
which is the better way to rsync files between web servers? cooljai Linux - Server 8 05-21-2010 11:32 PM
Could I run rsync to download files from a server without rsync daemon? Richard.Yang Linux - Software 1 09-18-2009 04:08 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:39 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration