LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 10-07-2014, 02:07 AM   #1
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Rep: Reputation: 13
How Would I Create/Write This Script?


Hello, firstly a disclaimer, I'm not a computer guy, I don't really *get* computers and I certainly don't know best practice. That said, I do use OwnCloud and this is a slight problem I have with it.

I have an external hard drive that OwnCloud writes to, but it takes too long to 'spin up' so the first picture of many always fails to upload. What I was thinking of doing is plugging in a USB stick so that it's always available, but then having the system move the files from the USB stick to the hard drive and then linking the file so that owncloud thinks it's still there.

My owncloud is kept in /media/owncloud
My usb would be in /media/usb.owncloud

My biggest problem with this is have no idea what I'm doing. I think I would use cron to run the script at 0400 in the morning or something.

Thanks
 
Old 10-07-2014, 02:18 AM   #2
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
read these it is simple stuff https://www.debian-administration.or...ling_with_cron

and this http://www.jveweb.net/en/archives/20...ith-rsync.html
that should handle your stuff.
 
Old 10-07-2014, 02:25 AM   #3
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Original Poster
Rep: Reputation: 13
Thanks for the reply. I'm not sure that rsync would be what I want, as the USB would probably run out of room pretty quickly. This was my thinking behind using a "link" ("ln" type of thing).
 
Old 10-07-2014, 07:08 AM   #4
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
there is different types of rysnc the type that adds to the folder. and the type that copys to the folder and does not delete from the main folder. if your just adding stuff to a folder then do a cron that adds your uploads then delets the usb folder. any way you look at it your just moving stuff from one folder to another.
mv /usb.owncloud/*.png /external-drive.ownclowd/
or cd usb
Code:
ln -s owncloud   /path/to/eternal/drive/owncloudrepo

Last edited by Drakeo; 10-07-2014 at 07:09 AM.
 
  


Reply



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] Is this the write way to write a 2 command loop script? Bobbyyyy Linux - Newbie 1 04-14-2014 02:03 PM
[SOLVED] Write a bash script to create a virtual juniorb0y007 Linux - Virtualization and Cloud 4 04-02-2013 02:17 PM
i want to write a shell script create backup of my system into a external hard disk. rajhans Linux - Newbie 6 03-30-2012 04:18 PM
how to write a script to create a directory mgam Linux - Newbie 1 10-29-2003 12:08 PM

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

All times are GMT -5. The time now is 03:30 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