[Solved] Tasker - File Copy (not so fun)

Last Updated:

  1. XplosiV

    XplosiV Master X is Watching You VIP Member

    So after having suffered from the S3's little nand memory eppy fit and corrupting, I figured if get tasker and see if I can set up some kind of backup thingy-mo-jiggy.

    Alas it seems pretty much impossible for me, so can anyone help? A click by click - step by step would be much appreciated.

    The aim:

    Copy files from one directory to another. Namely along the lines of;



    The files could be .jpg or .jpeg so do I also need to set up variables so both will copy?

    Much thanks, hope someone can help before I go completely insane.

  2. tatootie67

    tatootie67 Well-Known Member

    Wouldn't it be so much easier to use a file manager or USB than tasker??
  3. CodeMonkey

    CodeMonkey Well-Known Member

    I do something along these lines but using a third party app to do the grunt work, Foldersync.

    My profile fires at 5am each morning if the phone is in my "sleep" mode and connected to my home WiFi.
    It pings my server, wakes it up if it does not respond (using another third party plugin) and then fires a Foldersync profile to backup my phone files to a designated user area on the server. A notification alert is then left on the phone to indicate success / failure and launch Foldersync if pressed.
    XplosiV likes this.
  4. XplosiV

    XplosiV Master X is Watching You VIP Member

    I could as I'm paid up with root explorer, but the whole point of tasker was to make it automated or done via a widget.

    Yeah, that sounds good, maybe a little more for what I need. What's really frustrating is its all but one line of code in MS-DOS so you'd think something can be scripted to do the same in Android. Tasker just makes a meal out of it for code n00bs which is unfortunate, and the help fan's are next to useless.
  5. CodeMonkey

    CodeMonkey Well-Known Member

    Well I develop software for a living but I didn't fancy reinventing the wheel so went for the plugin solution :D
  6. userloser

    userloser Active Member

    try the rsync tasker plugin. it is not complicated if you know how to use rsync and ssh, and it is the handiest backup solution I've used on android.

    basically I dump the backups in some predetermined folders on the phone/tablet, and then when titanium backup fires a notification for completed weekly backup, tasker rsyncs everything to the home file server. setting up a context that responds to specific notifications is easy.

    the only minor problem is that the plugin doesn't seem to recognize tasker variables, so you're limited to one backup path per task.
    XplosiV likes this.
  7. XplosiV

    XplosiV Master X is Watching You VIP Member

    I finally got it sorted.

    Apparently my line of thinking was too complex. Maybe partly due to some examples I'd seen referencing specifying specific file extensions.

    Anyhow. To answer my own question. Here is a quick how to:

    With File Magic installed (not sure if it's used but hey)
    Open tasker.
    Create a profile.
    Specify TIME
    input desired time (00:30) for FROM
    tick repeat
    Untick TO

    This will run the TASK until it's competed.

    Now tap TASKS
    Add new
    Select file
    Select COPY DIR
    Tap the magnifying glass to the right of FROM
    Tap the bottom right arrow to go to the list of drives
    Select drive (in my case sdcard0)
    Select folder DCIM by LONG PRESSING
    Tap the magnifying glass to the right of TO
    Tap the bottom right arrow to go to the list of drives
    Select drive (in my case extsdcard)
    Select folder BACKUP by LONG PRESSING
    Tap the green tick.

    Rinse and repeat for any other folders you want, changing the source folders as needed.

    My backup takes about 4-5 min's to complete but it copies all files within source directories to the external sd card into the folder Backup. No root required (unless you want to backup root required files)

    Thanks for your help guys and girls.
  8. SUroot

    SUroot Well-Known Member Developer

    I too use foldersync. I don't even use it as a tasker plugin. Stand alone is fine.

    I use cron and rsync on Linux though.
  9. Droidwalking

    Droidwalking New Member

    I understand this was already solved. However, I found a stand-alone Tasker method to accomplish the same thing, so for anyone looking, try this:

    I wanted a way to back up my camera pictures, contact files (lost too many contacts because of "trial" address books and of course, ALL my Tasker settings (tasks, profiles, scripts, etc). Since Foldersync doesn't always work for me, I prefer to move files around myself to my different storage areas. This allows me to do that at my convenience.

    Since each is contained in it's own folder, I don't have a huge list of files that I don't know what they are / do. Don't delete the back-up folder, just move the contents inside. I found that to be a lot faster...but you can easily modify this to fit your needs.

    Profile: Saturday back-up
    From 00:00 - 00:02 (can be changed to fit your needs / phone speed)

    Task: Saturday back-up
    Create directory
    Dir back-up/contacts
    Run Shell
    Command sh /shcard/tasker/scripts/backup.sh
    Copy dir
    From Tasker/
    To back-up/Tasker
    Copy dir
    From DCIM/Camera
    To back-up

    And the backup script
    backup.sh (can be created using any text file editor
    mv /sdcard/contact*.vcf /sdcard/back-up/Contacts

    Automatically runs once a week. Very convenient for me without a lot of extra programs clogging up my phone and draining the battery.
    codesplice and D-U-R-X like this.

Share This Page