LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 03-16-2011, 11:06 PM   #1
blackthu80
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Rep: Reputation: 0
Shell script to copy all folders older than 7 days from Linux to Windows by samba


Hi all,

I want to make the script to copy all folders which older than 7 days from Linux server to Windows server by Samba.

And make it automatically by using cron

Pls help me.
 
Old 03-16-2011, 11:31 PM   #2
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 100Reputation: 100
Hi,

Split your question into 3 parts:
- mount your remote shared folder from Windows with mount -t cifs ...
- find all folders older than 7 days with find, --types, and -mtime
- copy it

Last edited by quanta; 03-17-2011 at 12:20 AM.
 
1 members found this post helpful.
Old 03-17-2011, 12:10 AM   #3
blackthu80
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you, quanta
You make me clear about the step to do

However, I'm newbie of Linux so could you please help me to make the script?
 
Old 03-17-2011, 12:21 AM   #4
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 100Reputation: 100
Try to make your script for yourself first, we will help you.
 
Old 03-17-2011, 12:29 AM   #5
blackthu80
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Hi,

I understand and tried to make by myselft already.

If it has any problem I couldn't solve, Pls help me.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash script to remove files older than 3 days rust8y Linux - General 26 10-04-2012 08:26 AM
Copy folders from windows machine to linux script lyschange Linux - Newbie 1 10-07-2010 02:40 AM
[SOLVED] Command to copy files older than <n> days keeping dir structure. MoonMan89 Linux - General 4 07-15-2010 10:28 PM
script to compress a directory and then delete older than 7 days replica88 Linux - General 3 02-03-2010 07:21 PM
shell script - auto ftp files that older than 60 days bakeng Linux - Newbie 2 12-25-2007 10:35 PM


All times are GMT -5. The time now is 02:41 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration