Thread: Periodically copy some files

  1. #1
    Registered User Hannibal2010's Avatar
    Join Date
    Jun 2011
    Location
    Hanoi, Vietnam
    Posts
    46

    Periodically copy some files

    Dear all,
    Now I have the problem: I need to copy some files from first directory to second directory periodically (for e.g, each hour).
    How can I call the function periodically and how can I copy files in C?
    Any help are welcome.

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Look up "Cron" in linux. "man Cron" should have info. You want to set up a "Cron job". I wouldn't advise making up your own program for this, because Linux already has a program designed just for this. Yours would just be a duplication of resources, if Cron will do it for you.

  3. #3
    Registered User Hannibal2010's Avatar
    Join Date
    Jun 2011
    Location
    Hanoi, Vietnam
    Posts
    46
    Hi Adak,
    Thanks for your help
    Sorry I did not notice, I want to run in Windows environment.

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Your fat penguin icon faked me out.

    Windows has the same thing basically. Go to Control Panel and Administrative Tools, then click on Task Scheduler. (Win 7). Other versions of Windows have Task Scheduler right in Control Panel, by itself, iirc.

    If you still want to do it in C, separately, then post back - I'm just trying to be as efficient as possible.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help to copy files in c++
    By Helgso in forum C++ Programming
    Replies: 52
    Last Post: 11-21-2008, 08:50 AM
  2. Trying to get my App to copy files with wildcards
    By Dwizard in forum Windows Programming
    Replies: 3
    Last Post: 09-30-2005, 05:49 PM
  3. Copy files
    By ErikDN in forum C Programming
    Replies: 1
    Last Post: 10-09-2004, 07:50 PM
  4. copy two files into one
    By waldis in forum C++ Programming
    Replies: 4
    Last Post: 10-20-2002, 06:08 PM
  5. how to do something periodically?
    By grey616 in forum C++ Programming
    Replies: 1
    Last Post: 02-07-2002, 03:17 AM