Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Syncing files to USB thumb drive [SOLVED]
PostPosted: Wed Aug 08, 2012 9:12 pm 
Offline

Joined: Fri Oct 28, 2011 7:25 pm
Posts: 57
I am using a SAM9G25 board and I am using a USB thumb drive for logging data and for easy swapping of drives to get the daily log. However, I'm having problems with all of the log files to get stored to the USB drive.

I have a cron job that grabs the latest syslog files and moves them to the USB thumb drive. After transferring the files the cron job calls "sync", which from my understanding should force all of the temporarily stored in RAM to be written to flash. However, when I swap the USB drives there is about 100MB less in log files than I expect; about the space in unused RAM on the system. So it looks like the files are still hanging out in RAM instead of being written to the flash drive.

Is there something else that I need to call to really force the files to commit to flash? I was hoping to avoid doing a "umount" followed by a "mount" (just seems unnecessary), but if that's what it takes then let me know.


Last edited by bevenson on Tue Oct 02, 2012 7:05 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: [SOLVED]Re: Syncing files to USB thumb drive
PostPosted: Tue Oct 02, 2012 7:03 pm 
Offline

Joined: Fri Oct 28, 2011 7:25 pm
Posts: 57
Just wanted to clean up an unanswered thread of mine. From my testing it looks like unmounting the USB flash drive after I perform a backup operation is the most effective and safest way to ensure all the files have been written to the USB flash drive and prevent any issues with hot swapping.

I also made a number of safety checks to my log backup to better deal with missing or faulty drives. Here's where I got some of my inspiration:

http://stackoverflow.com/questions/2366 ... dy-running

http://www.symantec.com/connect/downloa ... automation

http://louwrentius.com/blog/2011/08/scr ... illing-up/

Hope this helps someone else.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: