netcat, tar don't work under cron/at
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > netcat, tar don't work under cron/at




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    netcat, tar don't work under cron/at  
henrik@segeberg.de


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-05 08:49 PM

Hello newsgroup,

i am trying to copy some files from one machine to the other,
automatically.

therefore i created two scripts, which are using tar and netcat. one is
the sender and
the other the recipient:

#!/bin/sh
# Skriptname: copy_sender.sh
cd /var/log
/bin/tar -cv save/*  | /usr/bin/netcat 192.168.20.1 2265

#!/bin/sh
# Skriptname: /root/bin/copy_recipient.sh
cd /backups
/usr/bin/netcat -l -p 2265 -w 420 | /bin/tar xv

when i run them on the command-line (recipient first), everthing is
fine. The files get transfered
as expected.

however, when i run the recipient from "at" or "cron" i get an email
containing the errormessage

save/messages-20041110.gz
tar: Unerwartetes Dateiende im Archiv. (unexpected end of file in
archiv)
tar: Unerwartetes Dateiende im Archiv. (unexpected EOF in archiv)
tar: Nicht behebbarer Fehler: Programmabbruch. (unrecoverable error:
aborting)

i tried it with different types of files (html, big text files, just
tar, tgz)
under at/cron it doesn't work. The transfer is started but it doesn't
complete.

I also tried to send it from/to localhost.
There is a enough free space on both machines.

Both machines are running linux (kernel 2.6.5).

tar (GNU tar) 1.13.25
Copyright =A9 2001 Free Software Foundation, Inc.

at version 3.1.8

netcat [v1.10]

Does anybody have any suggestion why this does work from the shell but
not under at/cron ?

Thanks in advance
Henrik






[ Post a follow-up to this message ]



    Re: netcat, tar don't work under cron/at  
Mark Hittinger


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-05 08:49 PM

henrik@segeberg.de writes:
>#!/bin/sh
># Skriptname: copy_sender.sh
>cd /var/log
>/bin/tar -cv save/*  | /usr/bin/netcat 192.168.20.1 2265
^^
this should be -c   v is bad in the origination case

Later

Mark Hittinger
bugs@pu.net





[ Post a follow-up to this message ]



    Re: netcat, tar don't work under cron/at  
henrik@segeberg.de


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-05 08:49 PM

I tried it without verbose on the sender side but it doesn't change
anything. The first file is partly transfered and it is interrupted
with the following output:

save/messages-20050615.gz
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

original file size is 342076 bytes, only 7680 bytes get transfered.

Thanks
Henrik Lohse






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:14 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register