Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
General Discussions
Switcher Hangout (Windows to Mac)
Creating a .bash file for backup
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Ruzzhh" data-source="post: 1811809" data-attributes="member: 401642"><p>I need some help writing a .bash file for Mac that backs up photos on a extern HDD. I have some criterias:</p><p></p><ul> <li data-xf-list-type="ul">I should only need to run one single file and then it does all the backup work for me</li> <li data-xf-list-type="ul">I want it to run in the background</li> <li data-xf-list-type="ul">It shall search for all photos (.jpeg types are fine unless Mac uses different file types as well) and back them up in their original folder structure</li> <li data-xf-list-type="ul">It should only search for places you would usually place your photos in a Mac (like a photo folder, the desktop folder, different drives etc.)</li> <li data-xf-list-type="ul">If a single file or more fails to backup it shouldn't give me a notice and just keep on going (again I want it to run silently in the background)</li> <li data-xf-list-type="ul">It should back it all up on the extern HDD I've attached to the Mac under a folder called "PhotoBackup"</li> <li data-xf-list-type="ul">It should copy hidden files as well</li> <li data-xf-list-type="ul">Each time I run it it shall only add photos added since last time it was run</li> </ul><p></p><p></p><p>So basicly it's just a backup code that makes sure that all photos I have on my laptop is copied onto my HDD with the same folder structure. I've made this for PC, but I haven't got the skills to do it with Mac. Here's my .bat code (notice I have a script making it run as a hidden process):</p><p></p><p><em>@echo off</em></p><p><em>title Checking file integrities...</em></p><p><em>:: variables</em></p><p><em>SET odrive=%odrive:~0,2%</em></p><p><em>set backupcmd=xcopy /s /c /d /h /i /r /y /exclude:%drive%\excludelist.txt</em></p><p><em>echo off</em></p><p><em>%backupcmd% "%USERPROFILE%\*.jpg" "%drive%\backup"</em></p><p><em>%backupcmd% "D<img src="/mac_images/images/smilies/Undecided.png" class="smilie" loading="lazy" alt=":\" title="Undecided :\" data-shortname=":\" />*.jpg" "%drive%\backup\drive D"</em></p><p><em>%backupcmd% "E<img src="/mac_images/images/smilies/Undecided.png" class="smilie" loading="lazy" alt=":\" title="Undecided :\" data-shortname=":\" />*.jpg" "%drive%\backup\drive E"</em></p><p><em>@echo off</em></p><p><em>cls</em></p><p></p><p>If someone can make this work I would be thrilled. I'm even willing to pay for your trouble...</p></blockquote><p></p>
[QUOTE="Ruzzhh, post: 1811809, member: 401642"] I need some help writing a .bash file for Mac that backs up photos on a extern HDD. I have some criterias: [LIST] [*]I should only need to run one single file and then it does all the backup work for me [*]I want it to run in the background [*]It shall search for all photos (.jpeg types are fine unless Mac uses different file types as well) and back them up in their original folder structure [*]It should only search for places you would usually place your photos in a Mac (like a photo folder, the desktop folder, different drives etc.) [*]If a single file or more fails to backup it shouldn't give me a notice and just keep on going (again I want it to run silently in the background) [*]It should back it all up on the extern HDD I've attached to the Mac under a folder called "PhotoBackup" [*]It should copy hidden files as well [*]Each time I run it it shall only add photos added since last time it was run [/LIST] So basicly it's just a backup code that makes sure that all photos I have on my laptop is copied onto my HDD with the same folder structure. I've made this for PC, but I haven't got the skills to do it with Mac. Here's my .bat code (notice I have a script making it run as a hidden process): [I]@echo off title Checking file integrities... :: variables SET odrive=%odrive:~0,2% set backupcmd=xcopy /s /c /d /h /i /r /y /exclude:%drive%\excludelist.txt echo off %backupcmd% "%USERPROFILE%\*.jpg" "%drive%\backup" %backupcmd% "D:\*.jpg" "%drive%\backup\drive D" %backupcmd% "E:\*.jpg" "%drive%\backup\drive E" @echo off cls[/I] If someone can make this work I would be thrilled. I'm even willing to pay for your trouble... [/QUOTE]
Verification
Name this item 🌈
Post reply
Forums
General Discussions
Switcher Hangout (Windows to Mac)
Creating a .bash file for backup
Top