Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: cron email stopped

  1. #11
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    31,099
    Blog Entries
    15

    Default Re: cron email stopped

    Quote Originally Posted by pattiM View Post
    ... there seem to be a dizzying array of options, SFTP, FTPS, LFTP, ... then, deeper things like use of SSH, TLS, etc. I'm really only concerned about the plaintext FTP password (although I am no security expert!).
    Hi
    I would recommend sftp if that works, can you use your ssh key instead of a password?


    Code:
    #!/usr/bin/perl
    
    use Net::SFTP::Foreign;
    # perl-Net-SFTP-Foreign-1.93-lp151.1.1.noarch.rpm
    # from https://download.opensuse.org/repositories/devel:/languages:/perl/openSUSE_Leap_15.1/noarch/
    
    use warnings;
    use strict;
    
    my $host = "ftp.email.add";
    
    my $sftp = Net::SFTP::Foreign->new($host, user => 'email@email.add, password => '24398868');
    
    $sftp->error and die "Something bad happened: " . $sftp->error;
    
    $sftp->put("RH.webm", "RH.webm") or die "put failed: " . $sftp->error;
    $sftp->put("SWDOWNA.webm", "SWDOWNA.webm") or die "put failed: " . $sftp->error;
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  2. #12

    Default Re: cron email stopped

    Quote Originally Posted by malcolmlewis View Post
    Hmmm... I hadn't even thought of trying to use Perl. I guess I thought the ftp tool would be representative of modern linux robustness. OK, thanks. I'll check out that code. I'm really not sure where the problem is. I have sometimes-slow internet, but I though mput dealt with all that. (it hangs up during one of the mput's) That looks like paid software - I guess default linux software isn't very usable. I couldn't find good examples of bash scripting ftp and fail-detect/retry.

  3. #13

    Default Re: cron email stopped

    ...guess Python would also work. Trick is to do retries upon failure - and it's hard to do reliably in a bash script with ftp.

  4. #14
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    31,099
    Blog Entries
    15

    Default Re: cron email stopped

    Quote Originally Posted by pattiM View Post
    ...guess Python would also work. Trick is to do retries upon failure - and it's hard to do reliably in a bash script with ftp.
    Hi
    Should be able to loop if it fails...
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #15

    Default Re: cron email stopped

    Well, calling a Python script that used Python's ftplib to do the uploading worked. I guess their ftplib has built-in code to deal with spotty connections. I don't know why such a thing didnt' occur to me. Perl was also an idea - thanks for suggesting that - but I have never worked with Perl and it looks difficult. But it seems worth learning. (Maybe Padre or Eclipse/EPIC would make learning to do things in Perl easier.) Perl Maven has lots of stuff. I remember the linux guys in the 80's talking about Perl as something you needed to know.

    "[Perl] was initially designed to replace complex shell scripts."

    I'm sure it's a very different language now!

  6. #16
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,056

    Cool Re: cron email stopped

    Quote Originally Posted by pattiM View Post
    but I have never worked with Perl
    If you pick up the “Modern Perl” guide, Perl isn't too bad …

    Code:
    use Modern::Perl;
    The “Programming Perl” book – really a reference guide – takes some time to digest – 1070 pages …
    • ISBN: 978-0-5960049-2-7 – O'Reilly.

    To understand the difference between Perl 4 and 5 and, where Perl 6 went «Raku» and, the upcoming Perl 6, take a look at the Wikipedia page – <https://en.wikipedia.org/wiki/Perl>.

    You'll also need to note – <https://www.cpan.org/>.
    • The current (up to date) definitive definition of the Functions is there …
    • Plus the «perldoc» utility –

    Code:
     > perldoc
    Usage: perldoc [-hVriDtumUFXlT] [-n nroffer_program]
        [-d output_filename] [-o output_format] [-M FormatterModule]
        [-w formatter_option:option_value] [-L translation_code]
        PageName|ModuleName|ProgramName
    
    Examples:
    
        perldoc -f PerlFunc
        perldoc -q FAQKeywords
        perldoc -v PerlVar
        perldoc -a PerlAPI
    
    The -h option prints more help.  Also try "perldoc perldoc" to get
    acquainted with the system.                        [Perldoc v3.28]
     >
    What else?

    • Perl is TIMTOWTDI –

    There's more than one way to do it!

Page 2 of 2 FirstFirst 12

Posting Permissions

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