jberkel / sms-backup-plus

Backup Android SMS, MMS and call log to Gmail / Gcal / IMAP
https://play.google.com/store/apps/details?id=com.zegoggles.smssync
Apache License 2.0
1.79k stars 497 forks source link

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

Open Wibblyw opened 2 years ago

Wibblyw commented 2 years ago

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:

turkeyphant commented 2 years ago

Sane here.

Wibblyw commented 2 years ago

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

ner00 commented 2 years ago

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 commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

Same for me with Tasker

kurahaupo commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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! :)

MicWit commented 1 year ago

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 commented 1 year ago

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

MicWit commented 1 year ago

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 commented 1 year ago

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:

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 commented 1 year ago

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 commented 1 year ago

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

teezeuay commented 1 year ago

NOPE 😂 LAST TIME THE AUTO BACKUP STOPPED I REGENERATED A GOOGLE PASSWORD AND RESTARED THE PHONE. WORKED AGAIN FOR 8 MONTHS. I TRIED THAT THIS TIME AND NOTHING

On Wed, Feb 1, 2023 at 1:38 PM Martin Kealey @.***> wrote:

@teezeuay https://github.com/teezeuay By any chance did that coincide with upgrading Android on your device?

— Reply to this email directly, view it on GitHub https://github.com/jberkel/sms-backup-plus/issues/1076#issuecomment-1412620151, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5SBF3WYW45OJVTY7FSRFW3WVK3UPANCNFSM5RB4P4HA . You are receiving this because you were mentioned.Message ID: @.***>

ephemeris-lappis commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

abhisheknair commented 1 year ago

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

coman49 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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

Many thanks to henrichg.

eesheesh commented 8 months ago

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

henrichg commented 8 months ago

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 commented 8 months ago

Unfortunately, I'm having a similar problem with this fork. It doesn't auto-trigger the backup. As soon as I open the app, it connects, searches and backs up. All power management options are off and a manual backup works fine. Any suggestions?

My phone is on MIUI 14.0.5.0 which I believe is an Android v12 port. Phone is a Poco X3.

Thanks in advance.

On Thu, 26 Oct 2023 at 22:23, Henrich Gron @.***> wrote:

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).

— Reply to this email directly, view it on GitHub https://github.com/jberkel/sms-backup-plus/issues/1076#issuecomment-1780923722, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYOPLP35WH7XSLGRDCDEGZLYBJBZZAVCNFSM5RB4P4HKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZYGA4TEMZXGIZA . You are receiving this because you commented.Message ID: @.***>

henrichg commented 8 months ago

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 commented 8 months ago

its still a great app. manual backup once a week is not that hard

On Sat, Oct 28, 2023, 5:52 AM 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 https://github.com/jberkel/sms-backup-plus/issues/1076#issuecomment-1783776930, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5SBF3TP47NXDPWS36ERTCDYBTPYPAVCNFSM5RB4P4HKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZYGM3TONRZGMYA . You are receiving this because you were mentioned.Message ID: @.***>

sfc-juventino commented 8 months ago

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 https://github.com/jberkel/sms-backup-plus/issues/1076#issuecomment-1783776930, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYOPLP5QWTSP6GQYIBUHBVTYBTPYPAVCNFSM5RB4P4HKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZYGM3TONRZGMYA . You are receiving this because you commented.Message ID: @.***>

Wibblyw commented 8 months ago

Not that it helps others, but the Google Play Store version is working for me on a stock Pixel 6 on Android 14. Maybe because I installed it 2 years ago and not reinstalled since then?

On Sat, 28 Oct 2023, 12:15 pm teezeuay, @.***> wrote:

its still a great app. manual backup once a week is not that hard

On Sat, Oct 28, 2023, 5:52 AM 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 < https://github.com/jberkel/sms-backup-plus/issues/1076#issuecomment-1783776930>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/A5SBF3TP47NXDPWS36ERTCDYBTPYPAVCNFSM5RB4P4HKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZYGM3TONRZGMYA>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/jberkel/sms-backup-plus/issues/1076#issuecomment-1783781631, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJ6YM7L7ZITHWXVKUT6FETYBTSONAVCNFSM5RB4P4HKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZYGM3TQMJWGMYQ . You are receiving this because you were mentioned.Message ID: @.***>

henrichg commented 8 months ago

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

mrmwark commented 8 months ago

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:

Some other notes:

sfc-juventino commented 8 months ago

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 commented 4 months ago

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 commented 3 months ago

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 commented 3 months ago

@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.