Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic Backups not working [FIXED - make app exempt from power management] #1076

Open
Wibblyw opened this issue Mar 18, 2022 · 45 comments
Open
Labels
helpful provides information that may be useful to other users schedule related to automatic scheduled backups

Comments

@Wibblyw
Copy link

Wibblyw commented Mar 18, 2022

Before you report your issue, please consider perusing the https://github.com/jberkel/sms-backup-plus#faq and searching the issues page to see if it has already been reported.

Expected behaviour

Automatic backup

Actual behaviour

Automatic backups are not triggered, manual backups working ok

Steps to reproduce the behaviour

Set up Automatic backups (on arrival and on regular schedule). This used to work, until I noticed a while back it had stopped.

Please specify the following:

  • Android version
    12
  • Phone model / brand
    Pixel 6
  • SMS Backup+ version installed
    1.6.0-BETA2
  • Messaging app
    Google Messages
@turkeyphant
Copy link

Sane here.

@Wibblyw
Copy link
Author

Wibblyw commented Apr 1, 2022

I have now found setting the app to Unrestricted seems to work without undesirable side effects.

@ner00
Copy link

ner00 commented Jun 27, 2022

Any luck with this?

I just opened the app and its status was "Inactive", last backup was 3 months ago. Starting manually worked fine.
@Wibblyw What did you mean by "Unrestricted"? Did it help at all?

@kurahaupo kurahaupo added the schedule related to automatic scheduled backups label Sep 5, 2022
@kurahaupo
Copy link
Collaborator

@Wibblyw does "unrestricted" mean in relation to power management, ie, suppressing background activity by the app to save power? Or "unrestricted" in some other way?

@ner00
Copy link

ner00 commented Sep 5, 2022

Quick note: I recently used the Automate app to open SMS Backup + automatically in the background, it has been going strong for more than a month without any issues.

@kurahaupo
Copy link
Collaborator

kurahaupo commented Sep 6, 2022

Android introduced yet another new scheduling framework a few years ago; implementing it is still on the roadmap, and will likely resolve this and similar issues.

In the meantime, anyone having trouble should use "Automate" or similar.

@Wibblyw
Copy link
Author

Wibblyw commented Sep 6, 2022

Unrestricted is a power management setting I believe stops Android from restricting background power consumption by an app. I have not found this app consuming lots of battery as a result of using this setting - it seems well behaved, and fixes the issue for me.

@gpion
Copy link

gpion commented Sep 8, 2022

I recently used the Automate app to open SMS Backup + automatically in the background,

Same for me with Tasker

@kurahaupo
Copy link
Collaborator

Come to think of it, SMS Backup+ is on my list of power-management-exempt apps, and indeed it draws next to no power; for the time being we should probably just document this as a standard setup step.

@MicWit
Copy link

MicWit commented Sep 10, 2022

Unrestricted is a power management setting I believe stops Android from restricting background power consumption by an app. I have not found this app consuming lots of battery as a result of using this setting - it seems well behaved, and fixes the issue for me.

I have tried this on a Google pixel 6 pro (android 13) and it didn't help. Have set all correct permissions as well.

@gchartung
Copy link

Same here.
Pixel 6.
Power management exempt.
Manual backups work.
Tried 'Old backup scheduler' and it works initially when turned on but then stops.
Same thing with my wife's pixel 6.

@MicWit
Copy link

MicWit commented Sep 29, 2022

Same here. Pixel 6. Power management exempt. Manual backups work. Tried 'Old backup scheduler' and it works initially when turned on but then stops. Same thing with my wife's pixel 6.

If it works initially, try mucking around with do not disturb. I have found that some things will only work while do not disturb is on, and some while it is off (not related to sound, for example, can only use USB file transfer to PC when do not disturb is off, and android auto voice recognition goes haywire when it is off, so have to turn it on). If you try that, would be interesting if it is linked to their issues in that system.

@gchartung
Copy link

Same here. Pixel 6. Power management exempt. Manual backups work. Tried 'Old backup scheduler' and it works initially when turned on but then stops. Same thing with my wife's pixel 6.

If it works initially, try mucking around with do not disturb. I have found that some things will only work while do not disturb is on, and some while it is off (not related to sound, for example, can only use USB file transfer to PC when do not disturb is off, and android auto voice recognition goes haywire when it is off, so have to turn it on). If you try that, would be interesting if it is linked to their issues in that system.

I added the app to dnd so that it could interrupt. Did a manual backup and toggled the 'old backup scheduler' off/on and it has been working now for a couple of hours. Not sure how many of those steps are necessary. I really didn't want to mess with it since it's working.
Thanks for your help! :)

@kurahaupo kurahaupo added the helpful provides information that may be useful to other users label Sep 30, 2022
@kurahaupo kurahaupo changed the title Automatic Backups not working Automatic Backups not working [FIXED - adjust power management] Sep 30, 2022
@kurahaupo kurahaupo changed the title Automatic Backups not working [FIXED - adjust power management] Automatic Backups not working [FIXED - make app exempt from power management] Sep 30, 2022
@MicWit
Copy link

MicWit commented Oct 18, 2022

This is not fixed on a Google pixel 6. I have tried all suggestions and it's still not working. Will this be looked at?

@ner00
Copy link

ner00 commented Oct 18, 2022

Have you tried creating a task with Tasker or Automate? I personally use Automate, working flawlessly for a couple months now.

@MicWit
Copy link

MicWit commented Oct 18, 2022

Have you tried creating a task with Tasker or Automate? I personally use Automate, working flawlessly for a couple months now.

I tried, could not work out how to set it up. If this is going to be the work around for now, can someone do a tutorial on how to set it up?

@ner00
Copy link

ner00 commented Oct 18, 2022

I'll share the flow I have created for Automate and try to explain how to set it up properly. In my case the most difficult issue I had, even after having created a proper schedule, was failing to give proper permissions to the Automate app to run SMS Backup+ in the background on its own, without manual interaction.

Note: before starting, make sure to forcibly close SMS Backup+ in case it's running in the background.

  1. Install Automate app if you haven't yet;
  2. Download SMS Backup+.flo.zip (an Automate flow/task);
  3. Github doesn't allow attaching files with .flo extension, you must unzip/extract it from the file in the previous step;
  4. Open Automate and import the flow from SMS Backup+.flo which you extracted previously;
  5. The SMS Backup+ flow just imported will need a few individual permissions: "appear on top of other apps or parts of the screen" and "ignore battery optimizations", make sure those are enabled;
  6. Go back to Automate main screen and tap the menu button on the top-left corner, then Settings, then scroll down to the Safety-related options, make sure to enable "Run on system startup";
  7. Go back to your phone's main screen, tap and hold the Automate icon in order to access the app's info;

Here it gets trick for me to explain because depending on your version of Android and brand, it may differ from mine:

In Automate's App info screen, where you have the permissions and notifications settings, you should have an option that is probably already enabled which is "Autostart" (enable if not). Next you either have "Other permissions" or "Additional permissions" on its own or inside "Permissions", go there. I have currently these enabled:

  • "Show on Lock screen"
  • "Display pop-up windows while running in the background"
  • "Display pop-up window"
  • "Permanent notification"

Once you have this down, go back to Automate, open the SMS Backup+ flow and edit it (using bottom-right pencil icon). The last action in the flow is a Delay of 30 minutes (as I uploaded it), to do some testing you should edit that and make it 1 minute instead, then back out of the editing process and press the START button. What should happen when you start this is that SMS Backup+ will briefly pop a black screen to the front and disappear to the background. If that didn't happen, something is off... but if it did then great, last part...

To test if Automate is being able to run the app on it's own, go to SMS Backup+ App info (using app icon shortcut, for example) and force the SMS Backup+ app to stop. Within the next minute you should see the same behavior happen as when you started the flow manually: the app opens briefly a black screen and disappears. If that happened, then it's probably working fine, all that's left to do is test after a reboot and after sending an SMS or call to see if it syncs properly with Gmail. In the end, return to the Automate flow and edit the Delay action back to some timing that you're comfortable with, I personally use 30 minutes as interval.

Note: As mentioned in other comments, it is also crucial that you create a battery optimization exception for both Automate and SMS Backup+, otherwise it might interfere with its operation.

Not as straightforward as I'd like it to be, and probably there are some inconsistencies due to not having to do this part of the process in a while, but for the most part this should work. Let me know if it doesn't, I'll try to help.

@teezeuay
Copy link

my backup worked flawless on a samsung galaxy s9 for years with IMAP signin. 2 weeks ago the auto backup stopped. I regenerated a new password and restarted phone which worked last time. This time NO. I see in the past everyone said to use edge but I dont have the option to authenticate that way. I checked sleeping apps and battery settings which seem all correct. What am I missing. Manual backups work tho

@kurahaupo
Copy link
Collaborator

@teezeuay By any chance did that coincide with upgrading Android on your device?

@teezeuay
Copy link

teezeuay commented Feb 1, 2023 via email

@ephemeris-lappis
Copy link

Hello.
I've been using SMS Backup+ for many years on my old Samsun S7, and I installed it last weekend on my new Xiaomi with Android 13 / MIUI 14. Manual backup works, but automatic (scheduled or triggered by phone call) don't. I think I've tried all the mentioned configuration options about battery restriction, back ground execution and so on, and nothing make it work.
Some news or more experienced solutions ?
Regards.

@coman49
Copy link

coman49 commented Mar 7, 2023

Tried everything above but it's still not working on my Android 13 Galaxy Z Fold 3.
Battery, data, and permissions settings for the app are all set.
Tasker opens the app in foreground every 30 minutes.
Manual backups work, automated backups work for some time and then always stop working until a manual backup is performed again. Tried with the Old backup scheduler and with the new, same result.

@coman49
Copy link

coman49 commented Mar 7, 2023

Is there a way to initiate manual backup with Tasker? Or any other similar workarounds anybody can offer?

@abhisheknair
Copy link

Tried all listed solutions, none is able to trigger automatic backups. Manual backup is working fine.

@coman49
Copy link

coman49 commented Oct 13, 2023

Finally got it working. Tasker has a task action under 3rd party category called SMS Backup+ which fires an intent to run backup. Set up some profiles to run that task after calls and texts and also on a time interval. Now backup emails appear almost instantly. No need to make tasks to open the app, which caused the app to constantly pop up in foreground, tried to workaround that with other automations to counteract that but it was just causing more issues.

@sfc-juventino
Copy link

Finally got it working. Tasker has a task action under 3rd party category called SMS Backup+ which fires an intent to run backup. Set up some profiles to run that task after calls and texts and also on a time interval. Now backup emails appear almost instantly. No need to make tasks to open the app, which caused the app to constantly pop up in foreground, tried to workaround that with other automations to counteract that but it was just causing more issues.

Hi - total Tasker noobie. Do you have specific details on the settings for this ? I see the 3rd Party category but not what variables to add to make this work,

Same deal - SMS Backup+ works manually but not automatically anymore. I backup call logs, SMS and MMS. Thanks and appreciation in advance !

@coman49
Copy link

coman49 commented Oct 16, 2023

Finally got it working. Tasker has a task action under 3rd party category called SMS Backup+ which fires an intent to run backup. Set up some profiles to run that task after calls and texts and also on a time interval. Now backup emails appear almost instantly. No need to make tasks to open the app, which caused the app to constantly pop up in foreground, tried to workaround that with other automations to counteract that but it was just causing more issues.

Hi - total Tasker noobie. Do you have specific details on the settings for this ? I see the 3rd Party category but not what variables to add to make this work,

Same deal - SMS Backup+ works manually but not automatically anymore. I backup call logs, SMS and MMS. Thanks and appreciation in advance !

I think you first have to turn on "3rd party integration" in Auto backup settings in SMS Backup+, then in the Tasker when adding a task action you should see SMS Backup+ as an option under 3rd Party category, it has an If and a Label parameters but I didn't do anything with those and just used it as is by pressing the back arrow on the top left corner.

@sfc-juventino
Copy link

Tasker has a task action under 3rd party category called SMS Backup+

Yeah, I already had that turned on. Ok, well, I've created an app profile with the SMS Backup+ selected as under 3rd Party category. I'll let you know how it goes !

@coman49
Copy link

coman49 commented Oct 16, 2023

Tasker has a task action under 3rd party category called SMS Backup+

Yeah, I already had that turned on. Ok, well, I've created an app profile with the SMS Backup+ selected as under 3rd Party category. I'll let you know how it goes !

What I have set up is probably overkill but I attached screenshots showing what my Tasker looks like:

Screenshot_20231016_010059_Tasker
Screenshot_20231016_010325_Tasker
Screenshot_20231016_010355_Tasker
Screenshot_20231016_010431_Tasker
Screenshot_20231016_010601_Tasker

@sfc-juventino
Copy link

Tasker has a task action under 3rd party category called SMS Backup+

Yeah, I already had that turned on. Ok, well, I've created an app profile with the SMS Backup+ selected as under 3rd Party category. I'll let you know how it goes !

What I have set up is probably overkill but I attached screenshots showing what my Tasker looks like:

Screenshot_20231016_010059_Tasker Screenshot_20231016_010325_Tasker Screenshot_20231016_010355_Tasker Screenshot_20231016_010431_Tasker Screenshot_20231016_010601_Tasker

I've just simplified mine to this - I just want it to trigger and run every hour

Screenshot_2023-10-16-17-48-58-086-edit_net dinglisch android taskerm

@sfc-juventino
Copy link

Tasker has a task action under 3rd party category called SMS Backup+

Yeah, I already had that turned on. Ok, well, I've created an app profile with the SMS Backup+ selected as under 3rd Party category. I'll let you know how it goes !

What I have set up is probably overkill but I attached screenshots showing what my Tasker looks like:
Screenshot_20231016_010059_Tasker Screenshot_20231016_010325_Tasker Screenshot_20231016_010355_Tasker Screenshot_20231016_010431_Tasker Screenshot_20231016_010601_Tasker

I've just simplified mine to this - I just want it to trigger and run every hour

Screenshot_2023-10-16-17-48-58-086-edit_net dinglisch android taskerm

I'm happy to report that this works ! Just trigger it to run every hour and the app does it's thing :)

@mrmwark
Copy link

mrmwark commented Oct 26, 2023

SMS Backup+ has been forked and updated to work on Android 13:
https://github.com/henrichg/sms-backup-plus

Many thanks to henrichg.

@eesheesh
Copy link

Thanks @henrichg and @mrmwark! Are you planning to upload it to Google Play?

@henrichg
Copy link

Sorry not.

  1. It is not my application. I'm forked it only for fixing Android 13 support, for my user of PhoneProfilesPlus application.
  2. Is not possible to add it to Google Play, because target SDK is 29 (Android 10) and Google allows (currently) applications with target 32 (Android 12).

@sfc-juventino
Copy link

sfc-juventino commented Oct 28, 2023 via email

@henrichg
Copy link

By me, problem is with Android itself. Background applications are stopped at some time (for some manufacturers immediately).

For "Auto backup settings"/"Old backup scheduler" is used AlarmManager and this is stopped by Android for background applications.
Maybe is stopped also FirebaseJobDispatcher, which is used when "Old backup scheduler" is disabled. I do not know, in PhoneProfilesPlus (PPP) it is not used, is used WorkManager.

For avoid stop of background apps, PPP uses foreground service. It is service which must have permanent notification and is set as STICKY. And PPP has it. Also another similar apps have it (Tasker, Macrodroid, Automate, ...).

@teezeuay
Copy link

teezeuay commented Oct 28, 2023 via email

@sfc-juventino
Copy link

sfc-juventino commented Oct 28, 2023 via email

@Wibblyw
Copy link
Author

Wibblyw commented Oct 28, 2023 via email

@henrichg
Copy link

Regular schedule is working also in my S21.
Maybe problem is with Poco device.

@mrmwark
Copy link

mrmwark commented Oct 29, 2023

I did some testing on my S20+ (Android 13) with the regular schedule set to 30 minutes and incoming schedule set to 1 minute. According to my log entries:

  • Incoming SMS get backed up almost immediately and outgoing SMS takes around 5 minutes.
  • Incoming call log entries get backed up after a 2 or 3 minutes and outgoing call log takes 1 or 2 minutes.

Some other notes:

  • I'm now using incoming schedule set to "never" because immediate backup is not important to me, i.e. backup every 30 minutes is enough for me.
  • The regular schedule and the intent both work on my S20+.
  • Some devices seem to kill background apps even when the app is set to be excluded from background usage limits... I have a Sony device that does this all the time and as henrichg said, the best way to fix that is a persistent notification.
  • Another workaround to scheduling problems is to use PhoneProfilesPlus (or Tasker or similar) to start SMS Backup+ and send the intent to trigger a backup.

@sfc-juventino
Copy link

At the moment, the old backup scheduler is turned off. I'm going to turn it on and see what happens. I'll report back when I get new messages. Thanks for your reply.

On Sat, 28 Oct 2023, 21:52 Henrich Gron, @.> wrote: By me, problem is with Android itself. Background applications are stopped at some time (for some manufacturers immediately). For "Auto backup settings"/"Old backup scheduler" is used AlarmManager and this is stopped by Android for background applications. Maybe is stopped also FirebaseJobDispatcher, which is used when "Old backup scheduler" is disabled. I do not know, in PhoneProfilesPlus (PPP) it is not used, is used WorkManager. For avoid stop of background apps, PPP uses foreground service. It is service which must have permanent notification and is set as STICKY. And PPP has it. Also another similar apps have it (Tasker, Macrodroid, Automate, ...). — Reply to this email directly, view it on GitHub <#1076 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYOPLP5QWTSP6GQYIBUHBVTYBTPYPAVCNFSM5RB4P4HKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZYGM3TONRZGMYA . You are receiving this because you commented.Message ID: @.>

This seems to be working now with the Old Backup Scheduler turned on. Will continue to monitor but looks good !

@sfc-juventino
Copy link

Moved from a Poco X3 to a Poco X6 Pro and now I'm back to triggering this manually again. I have made it power management exempt but no deal

@sshaikh
Copy link

sshaikh commented Mar 26, 2024

Tasker has a task action under 3rd party category called SMS Backup+

Yeah, I already had that turned on. Ok, well, I've created an app profile with the SMS Backup+ selected as under 3rd Party category. I'll let you know how it goes !

What I have set up is probably overkill but I attached screenshots showing what my Tasker looks like:
Screenshot_20231016_010059_Tasker Screenshot_20231016_010325_Tasker Screenshot_20231016_010355_Tasker Screenshot_20231016_010431_Tasker Screenshot_20231016_010601_Tasker

I've just simplified mine to this - I just want it to trigger and run every hour
Screenshot_2023-10-16-17-48-58-086-edit_net dinglisch android taskerm

I'm happy to report that this works ! Just trigger it to run every hour and the app does it's thing :)

And @coman49 , does your tasker task still work? I've tried both the integration and intent but smsbackup+ doesn't start backing up (I presume it would show in the log?).

Edit: urgh and just like that it is working now.

@coman49
Copy link

coman49 commented Mar 26, 2024

@sshaikh yep mine works almost perfect. Tasker triggers backup immediately upon receiving texts and calls, though it doesn't trigger on sending texts or calling, but I also have a timed profile that triggers backup every 2 minutes. And yes the Run Log should show all the tasks running and any errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
helpful provides information that may be useful to other users schedule related to automatic scheduled backups
Projects
None yet
Development

No branches or pull requests