LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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, 08: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
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-02-2005, 08: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, 09: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, 09:14 AM   #4
jofisch
LQ Newbie
 
Registered: Jan 2005
Posts: 1

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

Code:
#!/bin/sh
bye
jofisch
 
2 members found this post helpful.
Old 02-02-2005, 09: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, 08: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, 01: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, 06: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... :-)
 
Old 03-23-2016, 12:35 PM   #9
hackerb9
LQ Newbie
 
Registered: Oct 2010
Distribution: Gnewsense
Posts: 5

Rep: Reputation: 0
Quote:
Originally Posted by jaapdr View Post
and even 9 years later... :-)
Indeed. It's been a decade and this is still helpful. Guess somebody (probably me) ought to file a bug report to make the run-parts man page more explicit about what its requirements are and what various errors mean.
 
Old 04-11-2017, 07:18 AM   #10
kevpatts
LQ Newbie
 
Registered: May 2004
Posts: 25

Rep: Reputation: 0
12 years and a month and you're still solving problems!
 
  


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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:58 AM.

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
Open Source Consulting | Domain Registration