Solved

Help running a script in linux

Posted on 2006-11-17
4
187 Views
Last Modified: 2013-12-06
Hi

I have a red hat 8 server and I have this script in a file named backup.sh

zip -ur9 /home/backup/ArchiverosTIN.zip -t $(date +%m01%Y) /home/Archiveros/ -x@/home/backup/excluir.txt
zip -r9 /home/backup/ProscaiTIN_$(date +%d%m%Y_%H-%M).zip /home/Archiveros/Archivos/PROSCAI/

when I run the command "sh backup.sh" everything is fine, and the backup is done and I get 2 zip files

I added a line to the crontab file to run this script automatically every day at midnight, and the backup starts as spected, but It never finish, I only get one incomplete zip file (it is incomplete 'cos it has a random name , no extension, and its about 30 MB when it should be about 200)

does some one know why?

thanks
0
Comment
Question by:rettiseert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 57

Accepted Solution

by:
giltjr earned 250 total points
ID: 17969113
I woud suggest adding:

     1> OutA.txt 2> ErrorA.txt
     1> OutB.txt 2> ErrorB.txt

To the end of each command respesctively.  The Out files will contain the STDOUT messages and the Error files will contain the STDERR messages.  This may give you an idea of what is working and what is failing.
0
 
LVL 14

Expert Comment

by:ygoutham
ID: 17970551
use the full path to zip

put it in as

/usr/bin/zip -r9 blah blah blah

0
 
LVL 13

Author Comment

by:rettiseert
ID: 18146460
actually, it was a network problem, at midnight the samba service was stopped and seems that tha caused the problem

giltjr suggestion was very hepulf thanks
0
 
LVL 57

Expert Comment

by:giltjr
ID: 18150215
Gald to see you solved the problem.  Although I personally would not call it a network problem.  If service is stopped, it is not a network issue that it can't be accessed.  :)
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SSL/TLS - openssl troubleshooting 3 81
UM7 Stop Sending packets with GPS Sensor 1 45
Linux kernel panic ext3-fs error 14 77
Krita v3 Linux Mint/Ubuntu 16.04 9 75
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question