Author Topic: Copy folder shell script  (Read 6667 times)

Offline applepie

  • Redd00r Developer
  • Developer
  • SuperHero Member
  • *****
  • Posts: 1487
  • Country: 00
  • Dormant Beast
    • View Profile
  • Device: iPod Touch 2G
  • My Computer: Mac
Copy folder shell script
« on: August 23, 2011, 05:37:53 AM »
Hey. This a kind of nooby question, but I'm trying to make a script to copy the iphone's photo's to another directory. I tried:

cp -f /private/var/mobile/Media/DCIM/100APPLE /private/var/mobile/Documents

To copy the files from the photos folder to the documents folder but I get an error. It works for individual files but not folders.


Offline realblack7

  • Omniscient and stuff...
  • SuperHero Member
  • *****
  • Posts: 650
  • Country: de
  • Human Instrumentality
    • View Profile
    • realblack7's Repo
  • Device: iPod Touch 1G
  • My Computer: Windows
Re: Copy folder shell script
« Reply #1 on: August 23, 2011, 07:33:38 AM »
add a /* after 100Apple. maybe this helps

or use -d instead of -f
Creator of RealBackup: Last Updated Post | Creator of iCloud for WD Info Page | iPhone 3GS
My Repo: cydia.realblack7.bplaced.net

Offline Bruan

  • Feature Developer
  • Administrator
  • SuperHero Member
  • *****
  • Posts: 13082
  • Country: 00
  • Methuselah
    • View Profile
    • Bruan_WD Twitter
  • Device: iPhone 3G
  • My Computer: Linux
Re: Copy folder shell script
« Reply #2 on: August 23, 2011, 11:46:42 AM »
cp -R /directorytocopy /directorymoved

Offline realblack7

  • Omniscient and stuff...
  • SuperHero Member
  • *****
  • Posts: 650
  • Country: de
  • Human Instrumentality
    • View Profile
    • realblack7's Repo
  • Device: iPod Touch 1G
  • My Computer: Windows
Re: Copy folder shell script
« Reply #3 on: August 23, 2011, 12:10:17 PM »
ahh..right..i used -d to check if a directory exists...not to copy stuff
« Last Edit: August 23, 2011, 01:23:59 PM by realblack7 »
Creator of RealBackup: Last Updated Post | Creator of iCloud for WD Info Page | iPhone 3GS
My Repo: cydia.realblack7.bplaced.net

Offline MotionLess

  • SuperHero Member
  • *****
  • Posts: 775
  • My epic master Obi-Brian ;)
    • View Profile
Re: Copy folder shell script
« Reply #4 on: August 27, 2011, 02:18:20 PM »
Or use the "mv" command :)

MetalCore Rulez D00D!

Offline Bruan

  • Feature Developer
  • Administrator
  • SuperHero Member
  • *****
  • Posts: 13082
  • Country: 00
  • Methuselah
    • View Profile
    • Bruan_WD Twitter
  • Device: iPhone 3G
  • My Computer: Linux
Re: Copy folder shell script
« Reply #5 on: August 27, 2011, 02:43:50 PM »
Or use the "mv" command :)

He did say copy, but yes, that works if you want to rename/move the folder.

Offline MotionLess

  • SuperHero Member
  • *****
  • Posts: 775
  • My epic master Obi-Brian ;)
    • View Profile
Re: Copy folder shell script
« Reply #6 on: August 27, 2011, 03:10:41 PM »
Oh didn't read well :S

MetalCore Rulez D00D!

Offline Bruan

  • Feature Developer
  • Administrator
  • SuperHero Member
  • *****
  • Posts: 13082
  • Country: 00
  • Methuselah
    • View Profile
    • Bruan_WD Twitter
  • Device: iPhone 3G
  • My Computer: Linux
Re: Copy folder shell script
« Reply #7 on: August 27, 2011, 11:20:11 PM »
No worries :P  Mv is helpful, as are you :)