Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8801143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:45:35+00:00 2026-06-14T00:45:35+00:00

I have a cron job setup that uses a script to download many files

  • 0

I have a cron job setup that uses a script to download many files from an FTP to a local server at a set time. It works absolutely fine when I manually run the script, It even works completely fine 9 out of 10 times via the cron. However, occasionally 1 of the files it’s set to get fails, and it throws a similar error to this:

ftp_get(): Opening BINARY mode data connection for Media_4.zip (421623342 bytes). in /home/crons/feeds/get_files.php on line 102

line 102 is the ftp_get(), I know there’s nothing wrong with it as it works fine when run manually/other automated attempts, but for full clarity:

foreach ($download_files as $download_file)
{
  $local_file = "{$path}/files/{$download_file}";
  $download = ftp_get($conn_id, $local_file, $download_file, FTP_BINARY);
  if (!$download) 
  {
    ftp_dl_log($queue_number, "FTP download has failed for $source_name: $download_file", "warn");
  } 
  else 
  {
    ftp_dl_log($queue_number, "Downloaded file successfully");
  }
}

I doubt it’s anything to do with file size, permissions, or anything like that, in total there is ~2gb spread across multiple files in total downloaded, sometimes it seems to just fail on one of the files, all other files are retrieved without a problem so I’m pretty confused. An example of all files would be:

Media_1.zip (600mb, downloads fine)
Media_2.zip (200mb, downloads fine)
Media_3.zip (700mb, downloads fine)
Media_4.zip (400mb, downloads fails)
Media_5.zip (300mb, downloads fine)
Media_6.zip (250mb, downloads fine)
Media_summary.csv (2mb, downloads fine)

Size restriction isn’t an issue, neither is a timeout occuring.

The file I’ve used as an example was uploaded to the ftp @

Oct 31 17:27

and the ftp_get() for the file occured @

Nov 01 03:14

So it couldn’t be that the file was incomplete at the time of request. And considering I can ftp_get() the same file without error later on it isn’t corrupt.

Does anyone know of any other things that could be causing this problem? Could the server performing other fetchs at the same time cause an issue?

Any suggestions or insight would be welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:45:36+00:00Added an answer on June 14, 2026 at 12:45 am

    I think you are probably looking at a server issue. If you are running feeds like this simultaneously it could be a load issue.

    I would try monitor the server load (using top or htop) at that time and probably re-distribute some other processes to give this one a bit more breathing space.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CRON job php script that I just set up not too
I have a python script that runs on a cron job. The script uses
I have a cron job the executes a PHP script. The cron is setup
Is it possible to setup a cron job from within a PHP script on
I have set up a cron job that is running through a large site
we have set up a cron job that cleans off old orders for our
I have a cron job to run a Ruby script, which runs fine on
If I have a cron job that run every 10 minutes and for some
I have a servlet running on GAE and I have a cron job that
I have a daily cron job that email PDFs to customers. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.