LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-02-2005, 09:25 AM   #1
ChoKamir
LQ Newbie
 
Registered: Jan 2005
Distribution: Debian Sarge
Posts: 6

Rep: Reputation: 0
run-parts gives error on bash script


Hello

I made a script that will backup my system monthly, placed it in cron.monthly. Anyway whenever i run the script manually by .sysbackup it works. But whenever i try run-parts --report /etc/cron.monthly it gives the following error:
run-parts: failed to exec /etc/cron.montly/sysbackup: Exec format error
run-parts: /etc/cron.monthly/sysbackup exited with return code 1

to complete the information the script is:
Code:
#Moves teh other backups one place up
/bin/mv /backup/system/sys.1.tar.gz /backup/system/sys.2.tar.gz
/bin/mv /backup/system/sys.tar.gz /backup/system/sys.1.tar.gz

#Makes the new backup
/bin/tar -cPzf /backup/system/sys.tar.gz /bin /boot /etc /home /var /usr /sbin /lib
/bin/chgrp admin /backup/system/sys.tar.gz
What is wrong with this script? Why can i execute it manually and not with run-parts.

Thanks a lot
ChoKamir
 
Old 02-02-2005, 09:42 AM   #2
nixcraft
Member
 
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
chmod +x /path/to/sysbackup
 
Old 02-02-2005, 10:06 AM   #3
ChoKamir
LQ Newbie
 
Registered: Jan 2005
Distribution: Debian Sarge
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for your reply, but the permissions of the file are already set to execute, otherwise the . sysbackup command would not have worked.

But thanks for responding anyways

ChoKamir
 
Old 02-02-2005, 10:14 AM   #4
jofisch
LQ Newbie
 
Registered: Jan 2005
Posts: 1

Rep: Reputation: 1
write this in the first line:

Code:
#!/bin/sh
bye
jofisch
 
1 members found this post helpful.
Old 02-02-2005, 10:22 AM   #5
ChoKamir
LQ Newbie
 
Registered: Jan 2005
Distribution: Debian Sarge
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks a lot that did the job

ChoKamir
 
Old 07-16-2008, 09:25 AM   #6
jpeach
LQ Newbie
 
Registered: Jul 2008
Posts: 2

Rep: Reputation: 0
Thanks

Thanks jofisch. That solved the problem for me too.
 
Old 01-31-2012, 02:36 AM   #7
Mark1986
Member
 
Registered: Aug 2008
Location: Netherlands
Distribution: Xubuntu
Posts: 87

Rep: Reputation: 11
And even a few years later this helps people. I seem to have gotten lazy...

Thanks for helping out!
 
Old 08-18-2014, 07:31 AM   #8
jaapdr
LQ Newbie
 
Registered: Aug 2014
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by Mark1986 View Post
And even a few years later this helps people. I seem to have gotten lazy...

Thanks for helping out!
and even 9 years later... :-)
 
  


Reply


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
Run my bash script as a daemon. jaimese Linux - Newbie 12 02-10-2011 04:28 PM
bash: run a script at most 3 times simultanously paterijk Programming 4 08-18-2005 03:49 PM
auto run bash script when logged in linuxmandrake Fedora 1 06-11-2005 09:22 PM
how to run one bash script from within another? babag Programming 9 04-28-2005 01:12 AM
Run script at login instead of bash uzi4u Linux - General 2 04-28-2004 03:31 PM


All times are GMT -5. The time now is 11:52 PM.

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