Professional Web Applications Themes

netcat, tar don't work under cron/at - Linux / Unix Administration

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 ...

  1. #1

    Default netcat, tar don't work under cron/at

    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 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

    henrik@segeberg.de Guest

  2. #2

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

    de writes: 
    ^^
    this should be -c v is bad in the origination case

    Later

    Mark Hittinger
    net
    Mark Guest

  3. #3

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

    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

    henrik@segeberg.de Guest

Similar Threads

  1. Cron job doesn't work
    By Karan in forum Linux / Unix Administration
    Replies: 9
    Last Post: July 25th, 09:58 PM
  2. netcat & jetdirect 500x 3 port
    By Dale Stover in forum SCO
    Replies: 0
    Last Post: August 6th, 03:06 PM
  3. netcat Error
    By Doug Luurs in forum SCO
    Replies: 2
    Last Post: July 29th, 04:20 PM
  4. Replies: 0
    Last Post: July 28th, 06:56 PM
  5. Replies: 1
    Last Post: July 27th, 04:28 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139