LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-24-2017, 01:24 AM   #1
poplinux
Member
 
Registered: May 2012
Posts: 111

Rep: Reputation: Disabled
Occured broken file that after download on my linux system


Dear Sir.

Some times occured the broken file on my linux system.

Filesystem is FAT16. I already know that FAT16 is very BAD choice. but I must use the FAT16.

My procedure is see below.

step 1. download My own file from my ftp server.
step 2. execute "sysc" command
step 3. execute "reboot -f"


Code:
#!/bin/sh

wget ftp://ID:PW@MY_FTP/my_file.bin
sync
reboot -f
What occured this situation?
And How to recover this situation?

Thank you.

Last edited by poplinux; 05-24-2017 at 01:26 AM.
 
Old 05-24-2017, 05:26 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,510

Rep: Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552
what I can imagine: you need to check if wget was really successful.
 
Old 05-24-2017, 05:45 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,505

Rep: Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113
I assume by broken file you mean the download failed. Could be many reasons and impossible for us to say. How often does this happen?

You can check the return status of wget to see if there is an error code. If the status is always zero even with a bad download there could be a network or server problem. If possible maybe add a checksum file to verify the download file is good. If either status or checksum verification fails then quit the script without rebooting. You could also automatically retry the download and quit after a set number.
 
Old 05-24-2017, 11:27 PM   #4
poplinux
Member
 
Registered: May 2012
Posts: 111

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
what I can imagine: you need to check if wget was really successful.
Download is OK. I was check the download file using sha1 check.
 
Old 05-24-2017, 11:27 PM   #5
poplinux
Member
 
Registered: May 2012
Posts: 111

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
I assume by broken file you mean the download failed. Could be many reasons and impossible for us to say. How often does this happen?

You can check the return status of wget to see if there is an error code. If the status is always zero even with a bad download there could be a network or server problem. If possible maybe add a checksum file to verify the download file is good. If either status or checksum verification fails then quit the script without rebooting. You could also automatically retry the download and quit after a set number.

Download is OK. I was check the download file using sha1 check.
 
Old 05-25-2017, 02:22 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,510

Rep: Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552
you do not need to post the same answer twice....
how did you check the file is broken?
 
Old 05-25-2017, 05:29 AM   #7
poplinux
Member
 
Registered: May 2012
Posts: 111

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
you do not need to post the same answer twice....
how did you check the file is broken?
Use the sha1 sum.

My file is have a sha1 sum.
 
Old 05-25-2017, 05:56 AM   #8
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,510

Rep: Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552Reputation: 5552
so do you mean the sha1 sum was different before and after reboot?
 
Old 05-25-2017, 02:41 PM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,262
Blog Entries: 10

Rep: Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160
Quote:
Originally Posted by poplinux View Post
My file is have a sha1 sum.
every file has a sha1 sum.
that in itself doesn't mean anything.
it's only meaningful if the sha1sum is the same as the one provided by the server that provided the download.
 
Old 05-26-2017, 03:47 AM   #10
poplinux
Member
 
Registered: May 2012
Posts: 111

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
so do you mean the sha1 sum was different before and after reboot?
Yes. is different before and after.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Error occured occured in execution of /var/cache/alps/scripts/systemd.sh FredBezies AryaLinux 11 05-11-2016 03:44 AM
Thunderbird .msf files broken! Windws/D read-only file system? xbaez Linux - Software 4 11-15-2012 04:50 PM
error occured during the file system check 7mza Linux - Newbie 2 05-19-2010 07:29 AM
[SOLVED] I added a system call in the Linux kernel, but a problem occured. corone Linux - Kernel 2 08-26-2009 05:22 AM
Download Red Hat Linux 9 - link broken Azzath LQ Suggestions & Feedback 10 08-14-2006 06:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration