• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Using Tasker to copy files

Vernon27

Member
Hello Group,

Can someone explain to me what is wrong with this Profile. I am trying to copy files from one directory to another and it does not seem to work.

Samsung Galaxy Note 3 running Kit Kat 4.4.2

- <TaskerData sr="" dvi="1" tv="4.6u3m">
- <Profile sr="prof55" ve="2">
<cdate>1396230790724</cdate>
<edate>1433604246959</edate>
<id>55</id>
<limit>true</limit>
<mid0>73</mid0>
<nme>Copy Tasker User Configuration Backup Files</nme>
- <Time sr="con0">
<fh>4</fh>
<fm>0</fm>
<th>4</th>
<tm>0</tm>
</Time>
</Profile>
- <Task sr="task73">
<cdate>1396230832786</cdate>
<edate>1433604246959</edate>
<id>73</id>
<nme>Copy Tasker User Configuration Files</nme>
<pri>10</pri>
- <Action sr="act0" ve="7">
<code>548</code>
<Str sr="arg0" ve="3">Backup has started. Please wait.</Str>
<Int sr="arg1" val="0" />
</Action>
- <Action sr="act1" ve="7">
<code>412</code>
<label>List the files in /storage/sdcard0/Tasker User Configuration Backups/Backups directory</label>
<Str sr="arg0" ve="3">/storage/sdcard0/Tasker User Configuration Backups/Backups</Str>
<Str sr="arg1" ve="3" />
<Int sr="arg2" val="1" />
<Int sr="arg3" val="0" />
<Str sr="arg4" ve="3">%FilesToMove</Str>
</Action>
- <Action sr="act10" ve="7">
<code>40</code>
<on>false</on>
</Action>
- <Action sr="act2" ve="7">
<code>39</code>
<Str sr="arg0" ve="3">%FilesToMove</Str>
<Str sr="arg1" ve="3">%FilesToMove()</Str>
</Action>
- <Action sr="act3" ve="7">
<code>404</code>
<label>Copy Files to /storage/sdcard0/Tasker User Configuration Backups/Cloud Sync</label>
<Str sr="arg0" ve="3">%FilesToMove</Str>
<Str sr="arg1" ve="3">/storage/sdcard0/Tasker User Configuration Backups/Cloud Sync</Str>
<Int sr="arg2" val="0" />
</Action>
- <Action sr="act4" ve="7">
<code>40</code>
</Action>
- <Action sr="act5" ve="7">
<code>548</code>
<Str sr="arg0" ve="3">Copy has been completed.</Str>
<Int sr="arg1" val="1" />
</Action>
- <Action sr="act6" ve="7">
<code>30</code>
<on>false</on>
<Int sr="arg0" val="0" />
<Int sr="arg1" val="0" />
<Int sr="arg2" val="0" />
<Int sr="arg3" val="1" />
<Int sr="arg4" val="0" />
</Action>
- <Action sr="act7" ve="7">
<code>412</code>
<on>false</on>
<Str sr="arg0" ve="3">/storage/sdcard0/Tasker User Configuration Backups/Tasker User Configuration Backups</Str>
<Str sr="arg1" ve="3">*.zip</Str>
<Int sr="arg2" val="0" />
<Int sr="arg3" val="0" />
<Str sr="arg4" ve="3">%FilesToDelete</Str>
</Action>
- <Action sr="act8" ve="7">
<code>39</code>
<on>false</on>
<Str sr="arg0" ve="3">%FilesToDelete</Str>
<Str sr="arg1" ve="3">%FilesToDelete()</Str>
</Action>
- <Action sr="act9" ve="7">
<code>406</code>
<on>false</on>
<Str sr="arg0" ve="3">%FilesToDelete</Str>
<Int sr="arg1" val="0" />
<Int sr="arg2" val="0" />
</Action>
</Task>
</TaskerData>
 

Attachments

I'm not quite sure what "doesn't work" means.

I suggest that you nibble away at it. Get one action at a time. When the action does what you want go to the next action.

I think your references need to be ...
Tasker User Configuration Backups
and not
/storage/sdcard 0/Tasker User Configuration Backups

It also behaves like there are embedded characters in your very-long folder name that are being displayed as blanks. Stuff is complex enough. I personally never use a blank in a folder or file name.

I tried TaskerBack/Backups after renaming the directory and the list seemed to work.

Good luck.

... Thom
 
I'm not quite sure what "doesn't work" means.

I suggest that you nibble away at it. Get one action at a time. When the action does what you want go to the next action.

I think your references need to be ...
Tasker User Configuration Backups
and not
/storage/sdcard 0/Tasker User Configuration Backups

It also behaves like there are embedded characters in your very-long folder name that are being displayed as blanks. Stuff is complex enough. I personally never use a blank in a folder or file name.

I tried TaskerBack/Backups after renaming the directory and the list seemed to work.

Good luck.

... Thom

Hello Thom,

Thanks for your suggestion. When I hit the magnifying glass is what I use to select the directories and they do not appear to have any special characters.

Here is and exported description for easy reference:

Profile: Copy Tasker User Configuration Backup Files (55)
Time: 04:00
Enter: Copy Tasker User Configuration Files (73)
A1: Flash [ Text:Backup has started. Please wait. Long:Off ]
<List the files in /storage/sdcard0/Tasker User Configuration Backups/Backups directory> A2: List Files [ Dir:/storage/sdcard0/Tasker User Configuration Backups/Backups Match: Include Hidden Files:On Use Root:Off Variable:%FilesToMove ]
A3: For [ Variable:%FilesToMove Items:%FilesToMove() ]
<Copy Files to /storage/sdcard0/Tasker User Configuration Backups/Cloud Sync>
A4: Copy File [ From:%FilesToMove To:/storage/sdcard0/Tasker User Configuration Backups/Cloud Sync Use Root:Off ]
A5: End For
A6: Flash [ Text:Copy has been completed. Long:On ]
A7: [X] Wait [ MS:0 Seconds:0 Minutes:0 Hours:1 Days:0 ]
A8: [X] List Files [ Dir:/storage/sdcard0/Tasker User Configuration Backups/Tasker User Configuration Backups Match:*.zip Include Hidden Files:Off Use Root:Off Variable:%FilesToDelete ]
A9: [X] For [ Variable:%FilesToDelete Items:%FilesToDelete() ]
A10: [X] Delete File [ File:%FilesToDelete Shred Level:0 Use Root:Off ]
A11: [X] End For

Sorry if I hijacked your quote.
 
Again ... what do you mean by "doesn't work"? The approach is to "nibble away at it".

I created ...
Tasker User Configuration Backups
Tasker User Configuration Backups/Backups
Tasker User Configuration Backups/Cloud Sync​
I copied six .txt files to /Backups
I imported the attachment in your original message
I ran the task
It copied the six files to /Cloud Sync

I looked at the Profile and it had a start time and end time set to 4:00
I set From: and To: for two minutes in the future.
I enabled the profile.
The Task never started.

I unchecked To: option and set the time for two minutes in the future.
I enabled the profile.
When the time arrived it copied the six files to /Cloud Sync

The approach is to "nibble away at it".

... Thom
 
Again ... what do you mean by "doesn't work"? The approach is to "nibble away at it".

I created ...
Tasker User Configuration Backups
Tasker User Configuration Backups/Backups
Tasker User Configuration Backups/Cloud Sync​
I copied six .txt files to /Backups
I imported the attachment in your original message
I ran the task
It copied the six files to /Cloud Sync

I looked at the Profile and it had a start time and end time set to 4:00
I set From: and To: for two minutes in the future.
I enabled the profile.
The Task never started.

I unchecked To: option and set the time for two minutes in the future.
I enabled the profile.
When the time arrived it copied the six files to /Cloud Sync

The approach is to "nibble away at it".

... Thom

Hello Thom,

The Profile appears to work. Not certain why it is working now. Also I have another problem I will post in a separate post.
 
Sir/madam ...

As I reported to you after investing MY time on YOUR problem ... the xml file that you included in your original message (that you relabeled as a txt file works. The only problem is that you had a from and to time set to the same value. Removing the to time solved the problem.

This also has a large section commented out (by you).

There were at least three different versions posted in this thread that you identified as "doesn't work". You have never answered the questions about how it doesn't work.

I have no idea what version you have now that "appears to work".

As for your new question ... perhaps someone else can help you with it.

Good luck.

... Thom
 
Back
Top Bottom