1

I want to download a file from another server and then save it to /dev/null in order to increase monthly traffic of the first server.

As man axel says, I should either use -o file or --output=file, but this is the issue:

axel -an16 -o /dev/null http://ip/file

When I run this and only when I want to save the output file to null file, I get this error:

File size: 4294967296 bytes
No state file, cannot resume!

But when I omit -o /dev/null as it exists, it works and starts downloading. Also when I use -o with some different name that doesn't exist, it works fine. While I can use wget -O /dev/null without any issues.

I googled a bit and it seems it's axel command bug but it's not resolved yet.

Am I right with the command? Or I'm doing something wrong here? Would you please help me if this is the right way or I should use wget command or even another way?

Saeed
  • 162
  • 10
  • 1
    What is the purpose of increasing traffic on first server? – Tero Kilkanen Aug 07 '20 at 14:27
  • Because the 1st server is using Mikrotik and will have symmetric traffic and I want it become asymmetric during the month (1 to 4 pattern or even 1 to 6). The second server has asymmetric and there will be problem for the second server. I will add it to crontab to do it daily. – Saeed Aug 07 '20 at 14:33
  • 1
    axel runs multiple threads and thus needs to know about the chunks it is downloading. It does that in a state file in the output directory. It writes the state file to /dev/null from where it, obviously, cannot read it again. Just start multiple wgets instead. – Frands Hansen Aug 07 '20 at 20:19

2 Answers2

1

As @Frands Hansen said in comments, I should use wget for this purpose:

axel runs multiple threads and thus needs to know about the chunks it is downloading. It does that in a state file in the output directory. It writes the state file to /dev/null from where it, obviously, cannot read it again. Just start multiple wgets instead.

Saeed
  • 162
  • 10
-1

As Frands Hansen stated in their comment, axel creates a "state file" in order to know where to resume the download from in the case it is ever interrupted for whatever reason, because it utilises multiple connections, each that do not download at the same speed.

That's why when you try to output the file to /dev/null, axel tries to create and write the progress to a state file that cannot exist because it tries to write it to /dev/null.

One solution that does work is to start the download in the current directory for axel to create the state file that it needs, then stop the download immediately with Ctrl+C, and make the output file where the actual data is downloaded (so not the *.st one) a symlink to /dev/null with :

ln -f -s /dev/null <your_file>

where <your_file> is the output file created by axel. Then you can re-run the same axel command you just ran before and all the downloaded data will be forwarded to /dev/null. You can then remove <your_file> to remove the symlink.

Lagoffre
  • 1
  • 1