View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


Search this Thread
Old 01-10-2007, 07:10 PM   #1
LQ Newbie
Registered: Jan 2007
Posts: 23

Rep: Reputation: 15
cannot execute binary file, though ownership and permissions are set correctly :(

Any suggestions, please?

This whole backup issue is bugging me for days and I can't get it working :'(

I want to use a script to do an automated backup of another machine using rsync.

Part of the problems I have is that if I try to rund the script it won't run:
cannot execute binary file

Ownership and permissions are set correctly
The User that should execute it has rx (500) on it. But neither he nor root can run it.

Here is the script:

# Script zieht per rsync Backups
# Aufruf: backup-rsync <fqdn-servername>

# ### Aufrufparameter des Scripts ist ein FQDN-Hostname
if [ -n "$1" ] ; then
	echo "Error: Usage $0 <fqdn-hostname>"

# ### Konfiguration
# Sollen wir pruefen, ob noch ein gewisser Prozentsatz 
# an Plattenplatz und Inodes frei ist?

# Soll die Daten-Partition readonly gemountet werden, 
# wenn wir sie nicht mehr brauchen?

# Unter welchem Pfad wird gesichert?

# Liste von Dateipattern, die nicht gebackupt werden sollen

# Weitere Optionen für rsync. Ggf. macht eine Limitierung 
# der Bandbreite Sinn, Angabe in kbyte/sec:
# EXTRAOPT="--bwlimit=256"

# ### Let´s Rock`n`Roll

# Pruefe auf freien Plattenplatz
GETPERCENTAGE='s/.* \([0-9]\{1,3\}\)%.*/\1/'
	KBISFREE=`df /$DATA_PATH | tail -n1 | sed -e "$GETPERCENTAGE"`
	INODEISFREE=`df -i /$DATA_PATH | tail -n1 | sed -e "$GETPERCENTAGE"`
		echo "Fatal: Not enough space left for rsyncing backups!"
		logger "Fatal: Not enough space left for rsyncing backups!"

# Festplatte rw remounten falls gewünscht!
if $MOUNT_RO ; then
        if `mount -o remount,rw $MOUNT_DEVICE $DATA_PATH` ; then
                echo "Error: Could not remount $MOUNT_DEV readwrite"
                logger "Error: Could not remount $MOUNT_DEV readwrite"

# Ggf. Verzeichnis anlegen
if ! [ -d $DATA_PATH/$SERVER/daily.0 ] ; then
        mkdir -p $DATA_PATH/$SERVER/daily.0

# Los geht`s: rsync zieht ein Vollbackup
echo "Starting rsync backup from $SERVER..."
logger "Starting rsync backup from $SERVER..."

rsync  -avz --numeric-ids -e ssh --delete --delete-excluded   \
        --exclude-from="$EXCLUDES"  $EXTRAOPT                   \
        $SERVER:/ $DATA_PATH/$SERVER/daily.0

# Rückgabewert prüfen.
# 0 = fehlerfrei, 
# 24 ist harmlos; tritt auf, wenn während der Laufzeit
# von rsync noch (/tmp?) Dateien verändert oder gelöscht wurden.
# Alles andere ist fatal -- siehe man (1) rsync
if ! [ $? = 24 -o $? = 0 ] ; then
	echo "Fatal: rsync finished $SERVER with errors!"
	logger "Fatal: rsync finished $SERVER with errors!"

# Verzeichnis anfassen, um Backup-Datum zu speichern
touch $DATA_PATH/$SERVER/daily.0

# Fertig!
echo "Finished rsync backup from $SERVER..."
logger "Finished rsync backup from $SERVER..."

# Sicher ist sicher...

# Festplatte ro remounten falls gewünscht!
if $MOUNT_RO ; then
        if `mount -o remount,ro $MOUNT_DEVICE $DATA_PATH` ; then
                echo "Error: Could not remount $MOUNT_DEV readonly"
                logger "Error: Could not remount $MOUNT_DEV readonly"

I tried it w/o success on a Suse 9.3 distrib (i586 OS on Opteron CPU) and Suse 10.0 (i586 OS on Athlon CPU).

What is the Prob here?

btw I am neither a newbee nor a linux pro, so please, if you suggest to take a certain action also mention how
Old 01-10-2007, 07:23 PM   #2
Registered: Aug 2003
Location: Indiana
Distribution: fc6 sles9 & 10 kubuntu ubuntu-server
Posts: 240
Blog Entries: 2

Rep: Reputation: 30
It could just be the Advanced Bash-Scripting Guide but I don't see a test for the lower case n (-n) at:
if [ -n "$1" ] ; then
however there is one for the uppercase -N
Old 01-10-2007, 07:57 PM   #3
LQ Newbie
Registered: Jan 2007
Posts: 23

Original Poster
Rep: Reputation: 15
thats already too much for me, plz specify

What could I do to get it running?

btw I did not write the script. It should be nothing wrong with it. It is from a tutorial and has been tested before. If there was just a mistake in the script it would have been found by now I assume.
Old 01-10-2007, 08:31 PM   #4
Registered: Jul 2004
Location: Tampa, Florida, USA
Distribution: Ubuntu
Posts: 734
Blog Entries: 1

Rep: Reputation: 31
xjlittle: check the manpage for bash, it's in there.

Where is the file located?
What are you typing on the commandline to run the file?
Is "cannot execute binary file" the exact output after you run it?
Old 01-11-2007, 04:27 AM   #5
LQ Newbie
Registered: Jan 2007
Posts: 23

Original Poster
Rep: Reputation: 15
Thank you for your answer

The script is named backup-rsync
and is located in /home/user_who_runs_it/backup/

when trying to run it I enter the complete path
or a relative one like ./backup/backup-rsync if I already am in the home directory of that user

I (auto)complete my commands using the tab key, so he dirs and files actually exist

The exact output is:
-bash: path/I/entered/backup-rsync: cannot execute binary file
Old 01-11-2007, 05:00 AM   #6
Senior Member
Registered: Jul 2004
Location: Ruhr Area, Germany
Distribution: Slackware64 14.0
Posts: 1,525

Rep: Reputation: 94
Do you have /home on a seperate partition? Please check the mount options for the partition where it is. Do you see something like "noexec" in this line? If yes change the appopriate line in /etc/fstab to include the "exec" option for this partition. See "man mount" if you want to know about this (in my manpage version type "/defaults" after invoking man and you will jump to these options).
Old 01-11-2007, 09:45 AM   #7
LQ Newbie
Registered: Jan 2007
Posts: 23

Original Poster
Rep: Reputation: 15
Gosch I just fixed that crap

First of all, thanks to you guys for your thoughts!

But, it was the script. I found it on another site and compared it to the one I already had (using ultraedit under win).
It turned out that there was one single character in the first line to be found before

It was never displayed though. Neither using Linux nor Windows!!
Couldn't delete it under Win either. But under Linux it worked.
Too weird for me, sorry

I still am afraid I am going to be back soon with the issues concerning rsync


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
Cannot execute binary file sonia gulrajani Programming 3 11-05-2006 02:30 AM
Cannot execute binary file Sigh Linux - Server 4 09-22-2006 08:43 AM
cannot execute binary file phanee Linux - Software 6 05-25-2006 02:16 PM
/etc/rc.d/rc.6: cannot execute binary file __spc__ Linux - General 11 04-17-2006 12:12 PM
cannot execute binary file.... ttaylor Linux - General 4 10-02-2001 02:37 AM

All times are GMT -5. The time now is 12:15 AM.

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 @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration