LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-06-2014, 06:26 PM   #1
Ratamahatta
Member
 
Registered: Feb 2012
Location: Germany
Distribution: siduction
Posts: 134

Rep: Reputation: 17
busybox system without sync command: what's best to do?


Hi!

I'm configuring a busybox system as a wire-bound downloader. I'm using a USB thumb drive to save the downloaded files to using a script. That script is meant to continue to run and check a file for more download links. Obviously I'd like to be able to unplug that device immediately when all downloads are finished. (At other times I'd let it connected and add more download links to the file.) But there's no sync command on this particular busybox system.
What's the best thing to do here? (Updating to an newer firmware is not an option as the internet provider this old box is from removed that telnet root access I'm using in later versions.)
Should I just umount/remount after all downloads are finished?
How long would it take until the system flushes the disk cache to the disk if I just waited?


Tried to add a sync link and this was the output when executing it:
Code:
BusyBox v1.00 (2007.04.23-03:09+0000) multi-call binary

Usage: busybox [function] [arguments]...
   or: [function] [arguments]...

        BusyBox is a multi-call binary that combines many common Unix
        utilities into a single executable.  Most people will create a
        link to busybox for each function they wish to use, and BusyBox
        will act like whatever it was invoked as.

Currently defined functions:
        [, ash, basename, busybox, cat, chmod, chown, chroot, cp, crond,
        crontab, cut, date, dd, df, dmesg, du, dumpleases, echo, egrep,
        env, expr, false, fdisk, fgrep, find, free, getopt, getty, grep,
        gunzip, gzip, hostname, httpd, ifconfig, inetd, init, insmod,
        kill, killall, klogd, ln, logger, login, logread, ls, lsmod, md5sum,
        mkdir, mknod, modprobe, more, mount, msh, mv, netstat, passwd,
        ping, ps, pwd, rdate, reboot, rm, rmdir, rmmod, route, sed, seq,
        sh, sha1sum, sleep, sysctl, syslogd, tail, tar, telnetd, test,
        tftp, top, touch, tr, true, tty, udhcpc, udhcpd, udhcpr, umount,
        uname, uptime, usleep, vi, wc, wget, xargs, zcat
 
Old 09-07-2014, 11:38 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Calling it as 'busybox mount --help' should show mount options. No idea if there are any sysctls that could influence VFS layer writes but I'm pretty sure the underlying umount syscall takes care of flushing, depending on the file system.
 
1 members found this post helpful.
Old 09-07-2014, 03:26 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,176

Rep: Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644
Create an alias or just add in a static build. Otherwise you have to rebuild busybox.
 
1 members found this post helpful.
Old 09-07-2014, 04:08 PM   #4
Ratamahatta
Member
 
Registered: Feb 2012
Location: Germany
Distribution: siduction
Posts: 134

Original Poster
Rep: Reputation: 17
Hi again!

Thanks for the responses.
Would have gone with jefro's suggestion (the alias). Then I realised what unSpawn was trying to tell me.
mount --help (the system has symbolic links to the busybox binary) only resulted in
Code:
BusyBox v1.00 (2007.04.23-03:09+0000) multi-call binary
Usage: mount [flags] DEVICE NODE [-o options,more-options]
but cat /etc/mtab yielded
Code:
/dev/sda1 /ramdisk/mnt/usb-storage/unknown-USB-0 vfat rw,sync 0 0
So it's synced automatically allready. Needed a push into the right direction, though.
Thanks again.
 
1 members found this post helpful.
Old 09-08-2014, 05:15 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,176

Rep: Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644Reputation: 3644
Thanks for the update and solution.
 
  


Reply

Tags
busybox, sync


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory leak using busybox - cp command? Lobinho Linux - Embedded & Single-board computer 3 03-26-2012 01:57 PM
System Dropped into BusyBOX dud33 Linux - Software 1 01-23-2012 01:30 AM
system sync command behavior with respect to file deletions. mmccaff1 Linux - Kernel 3 07-07-2009 12:20 PM
busybox command works, same command within script says permission denied jeroenv Linux - Newbie 2 01-17-2009 03:58 AM
adding a command in busybox jkeertir Linux - Kernel 1 03-27-2008 12:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:34 AM.

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